示例#1
0
        public void TestMatch()
        {
            Assert.IsTrue(RingSearch.Match(0, 0));
            Assert.IsTrue(RingSearch.Match(0, 1));
            Assert.IsTrue(RingSearch.Match(1, 0));
            Assert.IsTrue(RingSearch.Match(5, 0));
            Assert.IsTrue(RingSearch.Match(0, 5));
            Assert.IsTrue(RingSearch.Match(5, 5));

            Assert.IsFalse(RingSearch.Match(-1, -1));
            Assert.IsFalse(RingSearch.Match(6, 5));
            Assert.IsFalse(RingSearch.Match(5, 6));
            Assert.IsFalse(RingSearch.Match(-1, 5));
            Assert.IsFalse(RingSearch.Match(5, -1));
            Assert.IsFalse(RingSearch.Match(-1, 0));
            Assert.IsFalse(RingSearch.Match(0, -1));
        }