예제 #1
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Centipoise).Centipoise, CentipoiseTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.MillipascalSecond).MillipascalSeconds, MillipascalSecondsTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.NewtonSecondPerMeterSquared).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.PascalSecond).PascalSeconds, PascalSecondsTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Poise).Poise, PoiseTolerance);
 }
예제 #2
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = DynamicViscosity.From(1, DynamicViscosityUnit.Centipoise);

            AssertEx.EqualTolerance(1, quantity00.Centipoise, CentipoiseTolerance);
            Assert.Equal(DynamicViscosityUnit.Centipoise, quantity00.Unit);

            var quantity01 = DynamicViscosity.From(1, DynamicViscosityUnit.MicropascalSecond);

            AssertEx.EqualTolerance(1, quantity01.MicropascalSeconds, MicropascalSecondsTolerance);
            Assert.Equal(DynamicViscosityUnit.MicropascalSecond, quantity01.Unit);

            var quantity02 = DynamicViscosity.From(1, DynamicViscosityUnit.MillipascalSecond);

            AssertEx.EqualTolerance(1, quantity02.MillipascalSeconds, MillipascalSecondsTolerance);
            Assert.Equal(DynamicViscosityUnit.MillipascalSecond, quantity02.Unit);

            var quantity03 = DynamicViscosity.From(1, DynamicViscosityUnit.NewtonSecondPerMeterSquared);

            AssertEx.EqualTolerance(1, quantity03.NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance);
            Assert.Equal(DynamicViscosityUnit.NewtonSecondPerMeterSquared, quantity03.Unit);

            var quantity04 = DynamicViscosity.From(1, DynamicViscosityUnit.PascalSecond);

            AssertEx.EqualTolerance(1, quantity04.PascalSeconds, PascalSecondsTolerance);
            Assert.Equal(DynamicViscosityUnit.PascalSecond, quantity04.Unit);

            var quantity05 = DynamicViscosity.From(1, DynamicViscosityUnit.Poise);

            AssertEx.EqualTolerance(1, quantity05.Poise, PoiseTolerance);
            Assert.Equal(DynamicViscosityUnit.Poise, quantity05.Unit);

            var quantity06 = DynamicViscosity.From(1, DynamicViscosityUnit.PoundForceSecondPerSquareFoot);

            AssertEx.EqualTolerance(1, quantity06.PoundsForceSecondPerSquareFoot, PoundsForceSecondPerSquareFootTolerance);
            Assert.Equal(DynamicViscosityUnit.PoundForceSecondPerSquareFoot, quantity06.Unit);

            var quantity07 = DynamicViscosity.From(1, DynamicViscosityUnit.PoundForceSecondPerSquareInch);

            AssertEx.EqualTolerance(1, quantity07.PoundsForceSecondPerSquareInch, PoundsForceSecondPerSquareInchTolerance);
            Assert.Equal(DynamicViscosityUnit.PoundForceSecondPerSquareInch, quantity07.Unit);

            var quantity08 = DynamicViscosity.From(1, DynamicViscosityUnit.PoundPerFootHour);

            AssertEx.EqualTolerance(1, quantity08.PoundPerFootHours, PoundPerFootHoursTolerance);
            Assert.Equal(DynamicViscosityUnit.PoundPerFootHour, quantity08.Unit);

            var quantity09 = DynamicViscosity.From(1, DynamicViscosityUnit.PoundPerFootSecond);

            AssertEx.EqualTolerance(1, quantity09.PoundPerFootSeconds, PoundPerFootSecondsTolerance);
            Assert.Equal(DynamicViscosityUnit.PoundPerFootSecond, quantity09.Unit);

            var quantity10 = DynamicViscosity.From(1, DynamicViscosityUnit.Reyn);

            AssertEx.EqualTolerance(1, quantity10.Reyns, ReynsTolerance);
            Assert.Equal(DynamicViscosityUnit.Reyn, quantity10.Unit);
        }
예제 #3
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Centipoise).Centipoise, CentipoiseTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.MicropascalSecond).MicropascalSeconds, MicropascalSecondsTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.MillipascalSecond).MillipascalSeconds, MillipascalSecondsTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.NewtonSecondPerMeterSquared).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.PascalSecond).PascalSeconds, PascalSecondsTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Poise).Poise, PoiseTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.PoundForceSecondPerSquareFoot).PoundsForceSecondPerSquareFoot, PoundsForceSecondPerSquareFootTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.PoundForceSecondPerSquareInch).PoundsForceSecondPerSquareInch, PoundsForceSecondPerSquareInchTolerance);
     AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Reyn).Reyns, ReynsTolerance);
 }