@@ -171,16 +171,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
171
171
" ) ;
172
172
if ( _quantity . ValueType == "double" ) Writer . WL ( $@ "
173
173
[Fact]
174
- public void Ctor_WithInfinityValue_ThrowsArgumentException ()
174
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException ()
175
175
{{
176
- Assert.Throws<ArgumentException>(() => new { _quantity . Name } (double.PositiveInfinity, { _baseUnitFullName } ));
177
- Assert.Throws<ArgumentException>(() => new { _quantity . Name } (double.NegativeInfinity, { _baseUnitFullName } ));
176
+ var exception1 = Record.Exception(() => new { _quantity . Name } (double.PositiveInfinity, { _baseUnitFullName } ));
177
+ var exception2 = Record.Exception(() => new { _quantity . Name } (double.NegativeInfinity, { _baseUnitFullName } ));
178
+
179
+ Assert.Null(exception1);
180
+ Assert.Null(exception2);
178
181
}}
179
182
180
183
[Fact]
181
- public void Ctor_WithNaNValue_ThrowsArgumentException ()
184
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException ()
182
185
{{
183
- Assert.Throws<ArgumentException>(() => new { _quantity . Name } (double.NaN, { _baseUnitFullName } ));
186
+ var exception = Record.Exception(() => new { _quantity . Name } (double.NaN, { _baseUnitFullName } ));
187
+
188
+ Assert.Null(exception);
184
189
}}
185
190
" ) ; Writer . WL ( $@ "
186
191
@@ -248,16 +253,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
248
253
" ) ;
249
254
if ( _quantity . ValueType == "double" ) Writer . WL ( $@ "
250
255
[Fact]
251
- public void From{ _baseUnit . PluralName } _WithInfinityValue_ThrowsArgumentException ()
256
+ public void From{ _baseUnit . PluralName } _WithInfinityValue_DoNotThrowsArgumentException ()
252
257
{{
253
- Assert.Throws<ArgumentException>(() => { _quantity . Name } .From{ _baseUnit . PluralName } (double.PositiveInfinity));
254
- Assert.Throws<ArgumentException>(() => { _quantity . Name } .From{ _baseUnit . PluralName } (double.NegativeInfinity));
258
+ var exception1 = Record.Exception(() => { _quantity . Name } .From{ _baseUnit . PluralName } (double.PositiveInfinity));
259
+ var exception2 = Record.Exception(() => { _quantity . Name } .From{ _baseUnit . PluralName } (double.NegativeInfinity));
260
+
261
+ Assert.Null(exception1);
262
+ Assert.Null(exception2);
255
263
}}
256
264
257
265
[Fact]
258
- public void From{ _baseUnit . PluralName } _WithNanValue_ThrowsArgumentException ()
266
+ public void From{ _baseUnit . PluralName } _WithNanValue_DoNotThrowsArgumentException ()
259
267
{{
260
- Assert.Throws<ArgumentException>(() => { _quantity . Name } .From{ _baseUnit . PluralName } (double.NaN));
268
+ var exception = Record.Exception(() => { _quantity . Name } .From{ _baseUnit . PluralName } (double.NaN));
269
+
270
+ Assert.Null(exception);
261
271
}}
262
272
" ) ; Writer . WL ( $@ "
263
273
0 commit comments