Пример #1
0
        public void StrStrTest()
        {
            var testFunc = new ArrayQ();

            Assert.AreEqual(-1, testFunc.StrStr(string.Empty, "ll"));
            Assert.AreEqual(0, testFunc.StrStr("hello", string.Empty));
            Assert.AreEqual(0, testFunc.StrStr(string.Empty, string.Empty));
            Assert.AreEqual(2, testFunc.StrStr("hello", "ll"));
            Assert.AreEqual(-1, testFunc.StrStr("aaaaa", "bba"));
            Assert.AreEqual(0, testFunc.StrStr("aaaaa", "aaa"));
            Assert.AreEqual(1, testFunc.StrStr("baaaaa", "aaa"));
        }