Пример #1
0
        public void TestFormattingDimensionWithPowerOfOne()
        {
            var    dim    = new Dimension("hour", 1);
            string result = dim.Format(QuantityFormatInfo.CurrentInfo);

            Assert.AreEqual("h", result);
        }
Пример #2
0
        public void TestFormattingWithPrefix()
        {
            var    dim    = new Dimension("second", "mega");
            string result = dim.Format(QuantityFormatInfo.CurrentInfo);

            Assert.AreEqual("Ms", result);
        }
Пример #3
0
        public void TestFormattingDimension()
        {
            var    dim    = new Dimension("hour", -32);
            string result = dim.Format(QuantityFormatInfo.CurrentInfo);

            Assert.AreEqual("h⁻³²", result);
        }
Пример #4
0
        public void TestFormattingDimensionInAscii()
        {
            var    dim    = new Dimension("minute", 5);
            string result = dim.Format(new QuantityFormatInfo {
                AsciiOnly = true
            });

            Assert.AreEqual("min^5", result);
        }
Пример #5
0
        public void TestFormattingDimensionComplexFullName()
        {
            var    dim    = new Dimension("minute", -4);
            string result = dim.Format(new QuantityFormatInfo {
                TextualDescription = true
            });

            Assert.AreEqual("per minute to the power of 4", result);
        }
Пример #6
0
        public void TestFormattingDimensionWithPowerOfZeroFullName()
        {
            var    dim    = new Dimension("hour", 0);
            string result = dim.Format(new QuantityFormatInfo {
                TextualDescription = true
            });

            Assert.AreEqual("hour to the power of 0", result);
        }
Пример #7
0
        public void TestFormattingDimensionSimpleFullName()
        {
            var    dim    = new Dimension("second", 2);
            string result = dim.Format(new QuantityFormatInfo {
                TextualDescription = true
            });

            Assert.AreEqual("second squared", result);
        }
Пример #8
0
        public void TestFormattingDimensionWithPowerOfOneShowAllPowers()
        {
            var    dim    = new Dimension("hour", 1);
            string result = dim.Format(new QuantityFormatInfo {
                ShowAllPowers = true
            });

            Assert.AreEqual("h¹", result);
        }
Пример #9
0
        public void TestFormattingWithPrefixFullName()
        {
            var    dim    = new Dimension("metre", "pico");
            string result = dim.Format(new QuantityFormatInfo {
                TextualDescription = true
            });

            Assert.AreEqual("picometre", result);
        }