public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() { var quantity00 = VolumePerLength.From(1, VolumePerLengthUnit.CubicMeterPerMeter); AssertEx.EqualTolerance(1, quantity00.CubicMetersPerMeter, CubicMetersPerMeterTolerance); Assert.Equal(VolumePerLengthUnit.CubicMeterPerMeter, quantity00.Unit); var quantity01 = VolumePerLength.From(1, VolumePerLengthUnit.CubicYardPerFoot); AssertEx.EqualTolerance(1, quantity01.CubicYardsPerFoot, CubicYardsPerFootTolerance); Assert.Equal(VolumePerLengthUnit.CubicYardPerFoot, quantity01.Unit); var quantity02 = VolumePerLength.From(1, VolumePerLengthUnit.CubicYardPerUsSurveyFoot); AssertEx.EqualTolerance(1, quantity02.CubicYardsPerUsSurveyFoot, CubicYardsPerUsSurveyFootTolerance); Assert.Equal(VolumePerLengthUnit.CubicYardPerUsSurveyFoot, quantity02.Unit); var quantity03 = VolumePerLength.From(1, VolumePerLengthUnit.LiterPerMeter); AssertEx.EqualTolerance(1, quantity03.LitersPerMeter, LitersPerMeterTolerance); Assert.Equal(VolumePerLengthUnit.LiterPerMeter, quantity03.Unit); var quantity04 = VolumePerLength.From(1, VolumePerLengthUnit.OilBarrelPerFoot); AssertEx.EqualTolerance(1, quantity04.OilBarrelsPerFoot, OilBarrelsPerFootTolerance); Assert.Equal(VolumePerLengthUnit.OilBarrelPerFoot, quantity04.Unit); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, VolumePerLength.From(1, VolumePerLengthUnit.CubicMeterPerMeter).CubicMetersPerMeter, CubicMetersPerMeterTolerance); AssertEx.EqualTolerance(1, VolumePerLength.From(1, VolumePerLengthUnit.CubicYardPerFoot).CubicYardsPerFoot, CubicYardsPerFootTolerance); AssertEx.EqualTolerance(1, VolumePerLength.From(1, VolumePerLengthUnit.CubicYardPerUsSurveyFoot).CubicYardsPerUsSurveyFoot, CubicYardsPerUsSurveyFootTolerance); AssertEx.EqualTolerance(1, VolumePerLength.From(1, VolumePerLengthUnit.LiterPerMeter).LitersPerMeter, LitersPerMeterTolerance); AssertEx.EqualTolerance(1, VolumePerLength.From(1, VolumePerLengthUnit.OilBarrelPerFoot).OilBarrelsPerFoot, OilBarrelsPerFootTolerance); }