@@ -412,53 +412,30 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull()
412412 [Fact]
413413 public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit()
414414 {{
415- Assert.Multiple(() =>
416- {{
417- var quantity = new { _quantity . Name } (value: 1, unit: { _baseUnitFullName } );
418-
419- { _quantity . Name } convertedQuantity = quantity.ToUnit(UnitSystem.SI);
420-
421- Assert.Equal({ _baseUnitFullName } , convertedQuantity.Unit);
422- Assert.Equal(quantity.Value, convertedQuantity.Value);
423- }}, () =>
424- {{
425- IQuantity<{ _unitEnumName } > quantity = new { _quantity . Name } (value: 1, unit: { _baseUnitFullName } );
426-
427- IQuantity<{ _unitEnumName } > convertedQuantity = quantity.ToUnit(UnitSystem.SI);
428-
429- Assert.Equal({ _baseUnitFullName } , convertedQuantity.Unit);
430- Assert.Equal(quantity.Value, convertedQuantity.Value);
431- }});
432- }}
433-
434- [Fact]
435- public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit()
436- {{
437- IQuantity quantity = new { _quantity . Name } (value: 1, unit: { _baseUnitFullName } );
415+ var quantity = new { _quantity . Name } (value: 1, unit: { _baseUnitFullName } );
438416
439- IQuantity convertedQuantity = quantity.ToUnitUntyped (UnitSystem.SI);
417+ { _quantity . Name } convertedQuantity = quantity.ToUnit (UnitSystem.SI);
440418
441419 Assert.Equal({ _baseUnitFullName } , convertedQuantity.Unit);
442420 Assert.Equal(quantity.Value, convertedQuantity.Value);
443421 }}
444422
445-
446423 [Fact]
447424 public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
448425 {{
449426 UnitSystem nullUnitSystem = null!;
450427 Assert.Multiple(() =>
451428 {{
452429 var quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
453- Assert.Throws<ArgumentNullException>(() => quantity.ToUnitUntyped (nullUnitSystem));
430+ Assert.Throws<ArgumentNullException>(() => quantity.ToUnit (nullUnitSystem));
454431 }}, () =>
455432 {{
456433 IQuantity<{ _unitEnumName } > quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
457- Assert.Throws<ArgumentNullException>(() => quantity.ToUnitUntyped (nullUnitSystem));
434+ Assert.Throws<ArgumentNullException>(() => quantity.ToUnit (nullUnitSystem));
458435 }}, () =>
459436 {{
460437 IQuantity quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
461- Assert.Throws<ArgumentNullException>(() => quantity.ToUnitUntyped (nullUnitSystem));
438+ Assert.Throws<ArgumentNullException>(() => quantity.ToUnit (nullUnitSystem));
462439 }});
463440 }}
464441" ) ;
@@ -508,35 +485,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
508485 var expectedUnit = { _quantity . Name } .Info.GetDefaultUnit(UnitSystem.SI);
509486 var expectedValue = quantity.As(expectedUnit);
510487
511- Assert.Multiple(() =>
512- {{
513- { _quantity . Name } quantityToConvert = quantity;
514-
515- { _quantity . Name } convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
516-
517- Assert.Equal(expectedUnit, convertedQuantity.Unit);
518- Assert.Equal(expectedValue, convertedQuantity.Value);
519- }}, () =>
520- {{
521- IQuantity<{ _unitEnumName } > quantityToConvert = quantity;
522-
523- IQuantity<{ _unitEnumName } > convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
524-
525- Assert.Equal(expectedUnit, convertedQuantity.Unit);
526- Assert.Equal(expectedValue, convertedQuantity.Value);
527- }});
528- }}
529-
530- [Fact]
531- public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits()
532- {{
533- var quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
534- var expectedUnit = { _quantity . Name } .Info.GetDefaultUnit(UnitSystem.SI);
535- var expectedValue = quantity.As(expectedUnit);
536-
537- IQuantity quantityToConvert = quantity;
538-
539- IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI);
488+ { _quantity . Name } convertedQuantity = quantity.ToUnit(UnitSystem.SI);
540489
541490 Assert.Equal(expectedUnit, convertedQuantity.Unit);
542491 Assert.Equal(expectedValue, convertedQuantity.Value);
@@ -546,46 +495,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits()
546495 public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
547496 {{
548497 UnitSystem nullUnitSystem = null!;
549- Assert.Multiple(() =>
550- {{
551- var quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
552- Assert.Throws<ArgumentNullException>(() => quantity.ToUnit(nullUnitSystem));
553- }}, () =>
554- {{
555- IQuantity<{ _unitEnumName } > quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
556- Assert.Throws<ArgumentNullException>(() => quantity.ToUnit(nullUnitSystem));
557- }});
558- }}
559-
560- [Fact]
561- public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull()
562- {{
563- UnitSystem nullUnitSystem = null!;
564- IQuantity quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
565- Assert.Throws<ArgumentNullException>(() => quantity.ToUnitUntyped(nullUnitSystem));
498+ var quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
499+ Assert.Throws<ArgumentNullException>(() => quantity.ToUnit(nullUnitSystem));
566500 }}
567501
568502 [Fact]
569503 public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported()
570504 {{
571505 var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits);
572- Assert.Multiple(() =>
573- {{
574- var quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
575- Assert.Throws<ArgumentException>(() => quantity.ToUnit(unsupportedUnitSystem));
576- }}, () =>
577- {{
578- IQuantity<{ _unitEnumName } > quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
579- Assert.Throws<ArgumentException>(() => quantity.ToUnit(unsupportedUnitSystem));
580- }});
581- }}
582-
583- [Fact]
584- public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported()
585- {{
586- var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits);
587- IQuantity quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
588- Assert.Throws<ArgumentException>(() => quantity.ToUnitUntyped(unsupportedUnitSystem));
506+ var quantity = new { _quantity . Name } (value: 1, unit: { _quantity . Name } .BaseUnit);
507+ Assert.Throws<ArgumentException>(() => quantity.ToUnit(unsupportedUnitSystem));
589508 }}
590509" ) ;
591510 }
0 commit comments