예제 #1
0
        public void TestStateContainedB()
        {
            var state1 = new MissAndCan.State(2, 2, BoatState.Left, 1);
            var set    = new System.Collections.Generic.HashSet <State>(new StateEqualityComparer());

            set.Add(state1);
            Assert.AreEqual <bool>(true, set.Contains(state1));
        }
예제 #2
0
        public void TestStateContainedA()
        {
            var state1 = new MissAndCan.State(2, 2, BoatState.Left, 1);
            var state2 = new MissAndCan.State(2, 2, BoatState.Left, 1);
            var set    = new System.Collections.Generic.HashSet <State>();

            set.Add(state1);
            Assert.AreEqual <bool>(false, set.Contains(state2));
        }
예제 #3
0
        public void TestStateEquals()
        {
            var state1 = new MissAndCan.State(2, 2, BoatState.Left, 1);
            var state2 = new MissAndCan.State(2, 2, BoatState.Left, 1);

            Assert.AreEqual <bool>(true, state1.Equals(state2));
            var state3 = new MissAndCan.State(1, 2, BoatState.Left, 1);

            Assert.AreEqual <bool>(false, state1.Equals(state3));
            var state4 = new MissAndCan.State(2, 2, BoatState.Right, 1);

            Assert.AreEqual <bool>(false, state1.Equals(state4));
        }