コード例 #1
0
        public void TestRemovingOperatorwithBracket()
        {
            string expected;
            IEnumerable <InputElement> output = new List <InputElement>();

            ip.Clear();
            ip.GetseparatedPlainText("(", out output);

            expected = "(";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.DeleteLast(out output);
            expected = "";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.Clear();
            ip.GetseparatedPlainText("1", out output);
            ip.GetseparatedPlainText("F", out output);

            expected = "1 F";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.DeleteLast(out output);
            expected = "1";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.Clear();
            ip.GetseparatedPlainText("1", out output);
            ip.GetseparatedPlainText("T", out output);

            expected = "1 * T (";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.DeleteLast(out output);
            expected = "1 *";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.Clear();
            ip.GetseparatedPlainText("1", out output);
            ip.GetseparatedPlainText("Q", out output);

            expected = "1 * Q (";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.DeleteLast(out output);
            expected = "1 *";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.Clear();
            ip.GetseparatedPlainText("1", out output);
            ip.GetseparatedPlainText("A", out output);

            expected = "1 * A (";
            Assert.AreEqual <String>(expected, String.Join(" ", output));

            ip.DeleteLast(out output);
            expected = "1 *";
            Assert.AreEqual <String>(expected, String.Join(" ", output));
        }