コード例 #1
0
        public void TestDeleteInt()
        {
            // Check that nothing happens if were delete when nothing is present
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);

            // Add one digit and delete it
            input.AppendDigit(6);
            AssertValue("6", 6.0M, false);
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);
            // Still nothing happens if we delete "past" all digits
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);

            // Now add/delete a bunch of things
            input.AppendDigit(7);
            AssertValue("7", 7.0M, false);
            input.AppendDigit(8);
            AssertValue("78", 78.0M, false);
            input.AppendDigit(9);
            AssertValue("789", 789.0M, false);
            input.DeleteDigit();
            AssertValue("78", 78.0M, false);
            input.AppendDigit(0);
            AssertValue("780", 780.0M, false);
            input.DeleteDigit();
            AssertValue("78", 78.0M, false);
            input.AppendDigit(4);
            AssertValue("784", 784.0M, false);
            input.AppendDigit(1);
            AssertValue("7841", 7841.0M, false);
            input.DeleteDigit();
            AssertValue("784", 784.0M, false);
            input.DeleteDigit();
            AssertValue("78", 78.0M, false);
            input.DeleteDigit();
            AssertValue("7", 7.0M, false);
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);
            input.DeleteDigit();
            AssertValue("0", 0.0M, false);
        }