示例#1
0
        public void TestBuildMultipleDigits()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushDigit(1);
            builder.PushDigit(3);
            Assert.AreEqual(13, builder.GetValue());
        }
示例#2
0
        public void TestTrailingSeparator()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushDigit(1);
            builder.PushDigit(2);
            builder.PushSeparator();
            Assert.AreEqual(12, builder.GetValue());
        }
示例#3
0
        public void TestLeadingSeparator()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushSeparator();
            builder.PushDigit(1);
            builder.PushDigit(4);
            Assert.AreEqual(0.14M, builder.GetValue());
        }
示例#4
0
        public void TestSingleDigitDecimal()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushDigit(1);
            builder.PushSeparator();
            builder.PushDigit(2);
            Assert.AreEqual(1.2M, builder.GetValue());
        }
示例#5
0
        public void TestMultiDigitDecimal()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushDigit(1);
            builder.PushDigit(2);
            builder.PushSeparator();
            builder.PushDigit(3);
            builder.PushDigit(4);
            Assert.AreEqual(12.34M, builder.GetValue());
        }
示例#6
0
        public void TestAfterClear()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushDigit(1);

            builder.Clear();

            builder.PushDigit(2);
            Assert.AreEqual(2, builder.GetValue());
        }
示例#7
0
        public void TestSingleDigit()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushDigit(1);
            Assert.AreEqual(1, builder.GetValue());
        }
示例#8
0
        public void TestDoubleSeparator()
        {
            ValueBuilder builder = new ValueBuilder();

            builder.PushSeparator();
            builder.PushDigit(5);
            builder.PushSeparator();
        }