Beispiel #1
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Decawatt).Decawatts, DecawattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Deciwatt).Deciwatts, DeciwattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Femtowatt).Femtowatts, FemtowattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Gigawatt).Gigawatts, GigawattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Kilowatt).Kilowatts, KilowattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Megawatt).Megawatts, MegawattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Microwatt).Microwatts, MicrowattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Milliwatt).Milliwatts, MilliwattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Nanowatt).Nanowatts, NanowattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Petawatt).Petawatts, PetawattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Picowatt).Picowatts, PicowattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.SolarLuminosity).SolarLuminosities, SolarLuminositiesTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Terawatt).Terawatts, TerawattsTolerance);
     AssertEx.EqualTolerance(1, Luminosity.From(1, LuminosityUnit.Watt).Watts, WattsTolerance);
 }
Beispiel #2
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = Luminosity.From(1, LuminosityUnit.Decawatt);

            AssertEx.EqualTolerance(1, quantity00.Decawatts, DecawattsTolerance);
            Assert.Equal(LuminosityUnit.Decawatt, quantity00.Unit);

            var quantity01 = Luminosity.From(1, LuminosityUnit.Deciwatt);

            AssertEx.EqualTolerance(1, quantity01.Deciwatts, DeciwattsTolerance);
            Assert.Equal(LuminosityUnit.Deciwatt, quantity01.Unit);

            var quantity02 = Luminosity.From(1, LuminosityUnit.Femtowatt);

            AssertEx.EqualTolerance(1, quantity02.Femtowatts, FemtowattsTolerance);
            Assert.Equal(LuminosityUnit.Femtowatt, quantity02.Unit);

            var quantity03 = Luminosity.From(1, LuminosityUnit.Gigawatt);

            AssertEx.EqualTolerance(1, quantity03.Gigawatts, GigawattsTolerance);
            Assert.Equal(LuminosityUnit.Gigawatt, quantity03.Unit);

            var quantity04 = Luminosity.From(1, LuminosityUnit.Kilowatt);

            AssertEx.EqualTolerance(1, quantity04.Kilowatts, KilowattsTolerance);
            Assert.Equal(LuminosityUnit.Kilowatt, quantity04.Unit);

            var quantity05 = Luminosity.From(1, LuminosityUnit.Megawatt);

            AssertEx.EqualTolerance(1, quantity05.Megawatts, MegawattsTolerance);
            Assert.Equal(LuminosityUnit.Megawatt, quantity05.Unit);

            var quantity06 = Luminosity.From(1, LuminosityUnit.Microwatt);

            AssertEx.EqualTolerance(1, quantity06.Microwatts, MicrowattsTolerance);
            Assert.Equal(LuminosityUnit.Microwatt, quantity06.Unit);

            var quantity07 = Luminosity.From(1, LuminosityUnit.Milliwatt);

            AssertEx.EqualTolerance(1, quantity07.Milliwatts, MilliwattsTolerance);
            Assert.Equal(LuminosityUnit.Milliwatt, quantity07.Unit);

            var quantity08 = Luminosity.From(1, LuminosityUnit.Nanowatt);

            AssertEx.EqualTolerance(1, quantity08.Nanowatts, NanowattsTolerance);
            Assert.Equal(LuminosityUnit.Nanowatt, quantity08.Unit);

            var quantity09 = Luminosity.From(1, LuminosityUnit.Petawatt);

            AssertEx.EqualTolerance(1, quantity09.Petawatts, PetawattsTolerance);
            Assert.Equal(LuminosityUnit.Petawatt, quantity09.Unit);

            var quantity10 = Luminosity.From(1, LuminosityUnit.Picowatt);

            AssertEx.EqualTolerance(1, quantity10.Picowatts, PicowattsTolerance);
            Assert.Equal(LuminosityUnit.Picowatt, quantity10.Unit);

            var quantity11 = Luminosity.From(1, LuminosityUnit.SolarLuminosity);

            AssertEx.EqualTolerance(1, quantity11.SolarLuminosities, SolarLuminositiesTolerance);
            Assert.Equal(LuminosityUnit.SolarLuminosity, quantity11.Unit);

            var quantity12 = Luminosity.From(1, LuminosityUnit.Terawatt);

            AssertEx.EqualTolerance(1, quantity12.Terawatts, TerawattsTolerance);
            Assert.Equal(LuminosityUnit.Terawatt, quantity12.Unit);

            var quantity13 = Luminosity.From(1, LuminosityUnit.Watt);

            AssertEx.EqualTolerance(1, quantity13.Watts, WattsTolerance);
            Assert.Equal(LuminosityUnit.Watt, quantity13.Unit);
        }