public void BothAreEmpty() { var ImpStr = new ImplementStr(); var haystack = ""; var needle = ""; Assert.AreEqual(0, ImpStr.StrStr(haystack, needle)); }
public void NeedleLongerThanHaystack() { var ImpStr = new ImplementStr(); var haystack = "Test"; var needle = "Tests"; Assert.AreEqual(-1, ImpStr.StrStr(haystack, needle)); }
public void FindNeedle() { var ImpStr = new ImplementStr(); var haystack = "TestTest"; var needle = "st"; Assert.AreEqual(2, ImpStr.StrStr(haystack, needle)); }
public void FindNeedle1() { var ImpStr = new ImplementStr(); var haystack = "mississippi"; var needle = "issip"; Assert.AreEqual(4, ImpStr.StrStr(haystack, needle)); }
public void NeedleEmpty() { var ImpStr = new ImplementStr(); var haystack = "aa"; var needle = string.Empty; Assert.AreEqual(0, ImpStr.StrStr(haystack, needle)); }