public void TestLengths3DValue()
        {
            Assert.AreEqual(10d, CubicLength.FromMeter(10d).Meter, DoubleDelta);

            Assert.AreEqual(10d, CubicLength.FromMile(10d).Mile, DoubleDelta);
            Assert.AreEqual(10d, CubicLength.FromSeaMile(10d).SeaMile, DoubleDelta);
            Assert.AreEqual(10d, CubicLength.FromFeet(10d).Feet, DoubleDelta);
            Assert.AreEqual(10d, CubicLength.FromYard(10d).Yard, DoubleDelta);

            Assert.AreEqual(10d, CubicLength.FromLitre(10d).Litre, DoubleDelta);

            Assert.AreEqual(10d, CubicLength.FromBarrel(10d).Barrel, DoubleDelta);
            Assert.AreEqual(10d, CubicLength.FromCup(10d).Cup, DoubleDelta);
        }
Beispiel #2
0
 /// <summary>
 /// Calculates the cubic length 1 / (d / w)
 /// </summary>
 /// <param name="d"></param>
 /// <param name="w"></param>
 /// <returns></returns>
 public static CubicLength operator /(Density d, Mass w) => CubicLength.FromMeter(1 / (d.GramPerCubicMeter / w.Gram));
 public void TestLengths3DTo2DCalculation()
 {
     Assert.AreEqual(30d, (CubicLength.FromMeter(3d, UnitPrefix.Centi) / Length.FromMeter(10, UnitPrefix.Centi)).GetMeter(UnitPrefix.Milli), DoubleDelta);
 }
 public void TestLengths3DCalculation()
 {
     Assert.AreEqual(10000d, (CubicLength.FromMeter(3d, UnitPrefix.Centi) + CubicLength.FromMeter(0.007d, UnitPrefix.Deci)).GetMeter(UnitPrefix.Milli), DoubleDelta);
     Assert.AreEqual(10000d, (CubicLength.FromMeter(17d, UnitPrefix.Centi) - CubicLength.FromMeter(0.007d, UnitPrefix.Deci)).GetMeter(UnitPrefix.Milli), DoubleDelta);
 }
 public void TestLengths3DConvert()
 {
     Assert.AreEqual(250d, CubicLength.FromCup(1d).GetLitre(UnitPrefix.Milli), DoubleDelta);
     Assert.AreEqual(1000d, CubicLength.FromMeter(1d, UnitPrefix.Deci).GetLitre(UnitPrefix.Milli), DoubleDelta);
     Assert.AreEqual(100_000d, CubicLength.FromMeter(0.1d).GetLitre(UnitPrefix.Milli), DoubleDelta);
 }
Beispiel #6
0
 public static CubicLength operator *(Length m1, SquareLength m2) => CubicLength.FromMeter(m1.Meter * m2.Meter);
Beispiel #7
0
 public void TestCrossCalculation()
 {
     Assert.AreEqual(10d, (Mass.FromGram(20d) / CubicLength.FromMeter(2d)).GramPerCubicMeter);
 }