public void TestIsOneOf() { string[] choices = { "one", "two", "Three" }; Assert.IsTrue("one".IsOneOf(choices)); Assert.IsTrue("Three".IsOneOf(choices)); Assert.IsFalse("banananana".IsOneOf(choices)); Assert.IsFalse("one".IsOneOf(null)); Assert.IsFalse("one".IsOneOf()); Assert.IsFalse(StrFuncs.IsOneOf(null, choices)); }
public void TestIsSubstringOfAny() { string[] choices = { "twentyone", "TwentyTwo", "Veintitres" }; Assert.IsTrue("one".IsOneOf("twentyone", "TwentyTwo", "Veintitres")); Assert.IsTrue("Two".IsOneOf(choices)); Assert.IsTrue("Veintitres".IsOneOf(choices)); Assert.IsFalse("banananana".IsOneOf(choices)); Assert.IsFalse("one".IsOneOf(null)); Assert.IsFalse("one".IsOneOf()); Assert.IsFalse(StrFuncs.IsOneOf(null, choices)); }