Beispiel #1
0
 public void TestCrossCalculation()
 {
     Assert.AreEqual(30d, (Expedition.FromMetersPerSquareSecond(10d) * Mass.FromGram(3, UnitPrefix.Kilo)).Newton);
     Assert.AreEqual(2d, (Force.FromNewton(10d) / Mass.FromGram(5, UnitPrefix.Kilo)).MetersPerSquareSecond);
     Assert.AreEqual(10d, (Energy.FromJoule(20d) / Length.FromMeter(2d)).Newton);
     Assert.AreEqual(10d, (Force.FromNewton(20d) / SquareLength.FromMeter(2d)).Pascal);
 }
        public void TestLengths2DValue()
        {
            Assert.AreEqual(10d, SquareLength.FromMeter(10d).Meter, DoubleDelta);

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

            Assert.AreEqual(10d, SquareLength.FromAr(10d).Ar, DoubleDelta);
            Assert.AreEqual(10d, SquareLength.FromHectar(10d).Hectar, DoubleDelta);
        }
Beispiel #3
0
 public void TestCrossCalculation()
 {
     Assert.AreEqual(30d, (Pressure.FromPascal(10d) * SquareLength.FromMeter(3d)).Newton);
     Assert.AreEqual(0.2d, (Pressure.FromPascal(10d) / Force.FromNewton(2d)).Meter);
 }
Beispiel #4
0
 /// <summary>
 /// Calculates reciprocal: 1 / (p / f)
 /// </summary>
 /// <param name="p"></param>
 /// <param name="f"></param>
 /// <returns></returns>
 public static SquareLength operator /(Pressure p, Force f) => SquareLength.FromMeter(1d / (p.NewtonPerSquareMeter / f.Newton));
 public void TestLengths2Dto3DCalculation()
 {
     Assert.AreEqual(3_000d, (SquareLength.FromMeter(3d, UnitPrefix.Centi) * Length.FromMeter(10d, UnitPrefix.Milli)).GetMeter(UnitPrefix.Milli), DoubleDelta);
     Assert.AreEqual(3_000d, (Length.FromMeter(10d, UnitPrefix.Milli) * SquareLength.FromMeter(3d, UnitPrefix.Centi)).GetMeter(UnitPrefix.Milli), DoubleDelta);
 }
 public void TestLengths2DTo1DCalculation()
 {
     Assert.AreEqual(30d, (SquareLength.FromMeter(3d, UnitPrefix.Centi) / Length.FromMeter(10, UnitPrefix.Milli)).GetMeter(UnitPrefix.Milli), DoubleDelta);
 }
 public void TestLengths2DCalculation()
 {
     Assert.AreEqual(100d, (SquareLength.FromMeter(0.3d, UnitPrefix.Centi) + SquareLength.FromMeter(0.007d, UnitPrefix.Deci)).GetMeter(UnitPrefix.Milli), DoubleDelta);
     Assert.AreEqual(100d, (SquareLength.FromMeter(1.7d, UnitPrefix.Centi) - SquareLength.FromMeter(0.007d, UnitPrefix.Deci)).GetMeter(UnitPrefix.Milli), DoubleDelta);
 }
 public void TestLengths2DConvert()
 {
     Assert.AreEqual(10d, SquareLength.FromAr(1000d).Hectar, DoubleDelta);
     Assert.AreEqual(100d, SquareLength.FromMeter(1000d).GetHectar(UnitPrefix.Milli), DoubleDelta);
 }