コード例 #1
0
        public void RenderQuantity()
        {
            var q = new Quantity();

            q.Value = 4.5m;
            q.Code = "kg";
            q.System = "http://unitsofmeasure.org";

            Assert.AreEqual("4.5kg", q.ForDisplay());

            q.Units = "kilo";
            Assert.AreEqual("4.5 kilo", q.ForDisplay());

            q.Comparator = Quantity.QuantityCompararator.LessOrEqual;
            Assert.AreEqual("<=4.5 kilo", q.ForDisplay());
        }