コード例 #1
0
        public void ShouldNotEquals()
        {
            OneOrMore a, b;


            a      = new OneOrMore();
            a.Item = new Terminal('a');
            b      = new OneOrMore();
            b.Item = new Terminal('b');

            Assert.IsFalse(a.Equals(b));
            Assert.IsFalse(a.Equals(null));
            Assert.IsFalse(a.Equals(new AnyTerminal()));
            Assert.IsFalse(a.Equals(new EOS()));
        }
コード例 #2
0
        public void ShouldEquals()
        {
            OneOrMore a, b;


            a      = new OneOrMore();
            a.Item = new Terminal('a');
            b      = new OneOrMore();
            b.Item = new Terminal('a');

            Assert.IsTrue(a.Equals(b));
            Assert.IsTrue(b.Equals(a));
        }