コード例 #1
0
        public void BTNComparerReturnsTrueForBothNullBtn()
        {
            BTN btn       = null;
            BTN secondBtn = null;

            var results = BTNComparer.AreEqual(btn, secondBtn);

            Assert.IsTrue(results);
        }
コード例 #2
0
        public void BTNComparerReturnsFalseForDifferentBTN()
        {
            var btn = new BTN(1);

            btn.left        = new BTN(2);
            btn.right       = new BTN(3);
            btn.left.left   = new BTN(4);
            btn.left.right  = new BTN(5);
            btn.right.right = new BTN(6);
            btn.right.left  = new BTN(8);

            var secondBtn = new BTN(1);

            secondBtn.left        = new BTN(2);
            secondBtn.right       = new BTN(3);
            secondBtn.left.left   = new BTN(4);
            secondBtn.left.right  = new BTN(5);
            secondBtn.right.right = new BTN(6);
            secondBtn.right.left  = new BTN(7);

            var results = BTNComparer.AreEqual(btn, secondBtn);

            Assert.IsFalse(results);
        }
コード例 #3
0
        public void BTNComparerReturnsTrueForTheSameBTN()
        {
            var btn = new BTN(1);

            btn.left        = new BTN(2);
            btn.right       = new BTN(3);
            btn.left.left   = new BTN(4);
            btn.left.right  = new BTN(5);
            btn.right.right = new BTN(6);
            btn.right.left  = new BTN(7);

            var secondBtn = new BTN(1);

            secondBtn.left        = new BTN(2);
            secondBtn.right       = new BTN(3);
            secondBtn.left.left   = new BTN(4);
            secondBtn.left.right  = new BTN(5);
            secondBtn.right.right = new BTN(6);
            secondBtn.right.left  = new BTN(7);

            var results = BTNComparer.AreEqual(btn, secondBtn);

            Assert.IsTrue(results);
        }