Пример #1
0
        public void SetNotTest()
        {
            var s = new SearchState();

            foreach (var i in Enumerable.Range(1, 9))
            {
                Assert.IsTrue(s.CanBe(8, 8, i), $"Can't be {i} : {Math.Pow(2, i)}");
            }

            s.SetNot(8, 8, 6);


            foreach (var i in Enumerable.Range(1, 9).Where(n => n != 6))
            {
                Assert.IsTrue(s.CanBe(8, 8, i), $"Can be {i}");
            }

            Assert.IsFalse(s.CanBe(8, 8, 6), $"Can't be 6");

            s.SetNot(8, 8, 1);
            s.SetNot(8, 8, 2);
            s.SetNot(8, 8, 3);
            s.SetNot(8, 8, 4);
            s.SetNot(8, 8, 7);
            s.SetNot(8, 8, 8);
            s.SetNot(8, 8, 9);

            Assert.AreEqual(s[8, 8], 5);
        }