Esempio n. 1
0
        public void EqualityOfUnlikeUnits()
        {
            Assert.AreEqual(Tablespoon.S(6), Ounce.S(3));
            Assert.AreEqual(Tablespoon.S(8), Cup.S(0.5));
            Assert.AreEqual(Cup.S(0.5), Tablespoon.S(8));
            Assert.AreEqual(Gallon.S(2), Teaspoon.S(1536));
            Assert.AreNotEqual(Cup.S(6), Tablespoon.S(6));
            Assert.AreEqual(Inch.S(126720), Mile.S(2));
            Assert.AreNotEqual(Inch.Es(1), Teaspoon.S(1));
            Assert.AreNotEqual(Foot.S(2), Cup.S(0.5));

            Assert.AreEqual(6.Tablespoons(), 3.Ounces());
            Assert.AreEqual(8.Tablespoons(), 0.5.Cups());
            Assert.AreEqual(0.5.Cups(), 8.Tablespoons());
            Assert.AreEqual(2.Gallons(), 1536.Teaspoons());
            Assert.AreNotEqual(6.Cups(), 6.Tablespoons());
            Assert.AreNotEqual(1.Inches(), 1.Teaspoons());
            Assert.AreNotEqual(2.Feet(), 0.5.Cups());
        }
 public static RatioQuantity Inches(this int amount) => Inch.S(amount);