Example #1
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.CentilitersPerLiter).CentilitersPerLiter, CentilitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.CentilitersPerMililiter).CentilitersPerMililiter, CentilitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.DecalitersPerLiter).DecalitersPerLiter, DecalitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.DecalitersPerMililiter).DecalitersPerMililiter, DecalitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.DecilitersPerLiter).DecilitersPerLiter, DecilitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.DecilitersPerMililiter).DecilitersPerMililiter, DecilitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.DecimalFraction).DecimalFractions, DecimalFractionsTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.FemtolitersPerLiter).FemtolitersPerLiter, FemtolitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.FemtolitersPerMililiter).FemtolitersPerMililiter, FemtolitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.HectolitersPerLiter).HectolitersPerLiter, HectolitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.KilolitersPerLiter).KilolitersPerLiter, KilolitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.KilolitersPerMililiter).KilolitersPerMililiter, KilolitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.LitersPerLiter).LitersPerLiter, LitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.LitersPerMililiter).LitersPerMililiter, LitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.MicrolitersPerLiter).MicrolitersPerLiter, MicrolitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.MicrolitersPerMililiter).MicrolitersPerMililiter, MicrolitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.MillilitersPerLiter).MillilitersPerLiter, MillilitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.MillilitersPerMililiter).MillilitersPerMililiter, MillilitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.NanolitersPerLiter).NanolitersPerLiter, NanolitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.NanolitersPerMililiter).NanolitersPerMililiter, NanolitersPerMililiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerBillion).PartsPerBillion, PartsPerBillionTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerMillion).PartsPerMillion, PartsPerMillionTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerThousand).PartsPerThousand, PartsPerThousandTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerTrillion).PartsPerTrillion, PartsPerTrillionTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.Percent).Percent, PercentTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.PicolitersPerLiter).PicolitersPerLiter, PicolitersPerLiterTolerance);
     AssertEx.EqualTolerance(1, VolumeConcentration.From(1, VolumeConcentrationUnit.PicolitersPerMililiter).PicolitersPerMililiter, PicolitersPerMililiterTolerance);
 }
Example #2
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = VolumeConcentration.From(1, VolumeConcentrationUnit.CentilitersPerLiter);

            AssertEx.EqualTolerance(1, quantity00.CentilitersPerLiter, CentilitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.CentilitersPerLiter, quantity00.Unit);

            var quantity01 = VolumeConcentration.From(1, VolumeConcentrationUnit.CentilitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity01.CentilitersPerMililiter, CentilitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.CentilitersPerMililiter, quantity01.Unit);

            var quantity02 = VolumeConcentration.From(1, VolumeConcentrationUnit.DecilitersPerLiter);

            AssertEx.EqualTolerance(1, quantity02.DecilitersPerLiter, DecilitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.DecilitersPerLiter, quantity02.Unit);

            var quantity03 = VolumeConcentration.From(1, VolumeConcentrationUnit.DecilitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity03.DecilitersPerMililiter, DecilitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.DecilitersPerMililiter, quantity03.Unit);

            var quantity04 = VolumeConcentration.From(1, VolumeConcentrationUnit.DecimalFraction);

            AssertEx.EqualTolerance(1, quantity04.DecimalFractions, DecimalFractionsTolerance);
            Assert.Equal(VolumeConcentrationUnit.DecimalFraction, quantity04.Unit);

            var quantity05 = VolumeConcentration.From(1, VolumeConcentrationUnit.LitersPerLiter);

            AssertEx.EqualTolerance(1, quantity05.LitersPerLiter, LitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.LitersPerLiter, quantity05.Unit);

            var quantity06 = VolumeConcentration.From(1, VolumeConcentrationUnit.LitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity06.LitersPerMililiter, LitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.LitersPerMililiter, quantity06.Unit);

            var quantity07 = VolumeConcentration.From(1, VolumeConcentrationUnit.MicrolitersPerLiter);

            AssertEx.EqualTolerance(1, quantity07.MicrolitersPerLiter, MicrolitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.MicrolitersPerLiter, quantity07.Unit);

            var quantity08 = VolumeConcentration.From(1, VolumeConcentrationUnit.MicrolitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity08.MicrolitersPerMililiter, MicrolitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.MicrolitersPerMililiter, quantity08.Unit);

            var quantity09 = VolumeConcentration.From(1, VolumeConcentrationUnit.MillilitersPerLiter);

            AssertEx.EqualTolerance(1, quantity09.MillilitersPerLiter, MillilitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.MillilitersPerLiter, quantity09.Unit);

            var quantity10 = VolumeConcentration.From(1, VolumeConcentrationUnit.MillilitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity10.MillilitersPerMililiter, MillilitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.MillilitersPerMililiter, quantity10.Unit);

            var quantity11 = VolumeConcentration.From(1, VolumeConcentrationUnit.NanolitersPerLiter);

            AssertEx.EqualTolerance(1, quantity11.NanolitersPerLiter, NanolitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.NanolitersPerLiter, quantity11.Unit);

            var quantity12 = VolumeConcentration.From(1, VolumeConcentrationUnit.NanolitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity12.NanolitersPerMililiter, NanolitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.NanolitersPerMililiter, quantity12.Unit);

            var quantity13 = VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerBillion);

            AssertEx.EqualTolerance(1, quantity13.PartsPerBillion, PartsPerBillionTolerance);
            Assert.Equal(VolumeConcentrationUnit.PartPerBillion, quantity13.Unit);

            var quantity14 = VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerMillion);

            AssertEx.EqualTolerance(1, quantity14.PartsPerMillion, PartsPerMillionTolerance);
            Assert.Equal(VolumeConcentrationUnit.PartPerMillion, quantity14.Unit);

            var quantity15 = VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerThousand);

            AssertEx.EqualTolerance(1, quantity15.PartsPerThousand, PartsPerThousandTolerance);
            Assert.Equal(VolumeConcentrationUnit.PartPerThousand, quantity15.Unit);

            var quantity16 = VolumeConcentration.From(1, VolumeConcentrationUnit.PartPerTrillion);

            AssertEx.EqualTolerance(1, quantity16.PartsPerTrillion, PartsPerTrillionTolerance);
            Assert.Equal(VolumeConcentrationUnit.PartPerTrillion, quantity16.Unit);

            var quantity17 = VolumeConcentration.From(1, VolumeConcentrationUnit.Percent);

            AssertEx.EqualTolerance(1, quantity17.Percent, PercentTolerance);
            Assert.Equal(VolumeConcentrationUnit.Percent, quantity17.Unit);

            var quantity18 = VolumeConcentration.From(1, VolumeConcentrationUnit.PicolitersPerLiter);

            AssertEx.EqualTolerance(1, quantity18.PicolitersPerLiter, PicolitersPerLiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.PicolitersPerLiter, quantity18.Unit);

            var quantity19 = VolumeConcentration.From(1, VolumeConcentrationUnit.PicolitersPerMililiter);

            AssertEx.EqualTolerance(1, quantity19.PicolitersPerMililiter, PicolitersPerMililiterTolerance);
            Assert.Equal(VolumeConcentrationUnit.PicolitersPerMililiter, quantity19.Unit);
        }