Exemple #1
0
        public void DivideTest()
        {
            var m1 = new BaseMeasure("a");
            var m2 = new BaseMeasure("b");

            Measures.Instance.Add(m1);
            Measures.Instance.Add(m2);
            var u1 = new BaseUnit(m1, 1, "s", "pikkus");
            var u2 = new BaseUnit(m2, 1, "t", "aeg");

            Units.Instance.Add(u1);
            Units.Instance.Add(u2);
            var u = u1.Divide(u2);

            Assert.AreEqual("s*t^-1", u.Formula());
            Assert.AreEqual("a^1*b^-1", u.Measure.Name);
            Assert.AreEqual("pikkus*aeg^-1", u.Formula(true));
        }