public void Contains_of_empty_blacklist_returns_false_for_all_words() { CommonBlacklist target = new CommonBlacklist(); Assert.IsFalse(target.Countains("private")); Assert.IsFalse(target.Countains("int")); Assert.IsFalse(target.Countains("public")); Assert.IsFalse(target.Countains("void")); }
public void Contains_returns_false_for_words_not_added() { CommonBlacklist target = new CommonBlacklist(); target.Add("public"); target.Add("void"); Assert.IsFalse(target.Countains("private")); Assert.IsFalse(target.Countains("int")); }
public void Contains_returns_true_for_words_added() { CommonBlacklist target = new CommonBlacklist(); target.Add("public"); target.Add("void"); Assert.IsTrue(target.Countains("public")); Assert.IsTrue(target.Countains("void")); }
public void Empty_string_will_be_added_usually() { CommonBlacklist target = new CommonBlacklist(); target.Add(string.Empty); Assert.AreEqual(1, target.Count); Assert.IsTrue(target.Countains(string.Empty)); }
public void Null_will_be_added_usually_no_exception() { CommonBlacklist target = new CommonBlacklist(); target.Add(null); Assert.AreEqual(1, target.Count); Assert.IsTrue(target.Countains(null)); }
public void Contains_returns_true_for_case_different_same_word_added_twice() { CommonBlacklist target = new CommonBlacklist(); target.Add("PriVate"); target.Add("pRIVAte"); Assert.IsTrue(target.Countains("private")); }
public void Contains_returns_true_for_identical_word_added_twice() { CommonBlacklist target = new CommonBlacklist(); target.Add("private"); target.Add("private"); Assert.IsTrue(target.Countains("private")); }
public void Newly_created_blacklist_using_array_parameter_has_appropriate_words() { var inputArray = new[] { "public", "void", "MethodName" }; CommonBlacklist target = new CommonBlacklist(inputArray); foreach (var inputWord in inputArray) { Assert.IsTrue(target.Countains(inputWord)); } }
public void A_blacklist_constructed_with_explicit_case_aware_StringComparer_is_case_sensitive() { var inputArray = new[] { "publiC", "Void", "MethodName" }; CommonBlacklist target = new CommonBlacklist(inputArray, StringComparer.InvariantCulture); foreach (var exactMatchWord in inputArray) { Assert.IsTrue(target.Countains(exactMatchWord)); } Assert.IsFalse(target.Countains("PuBlic")); Assert.IsFalse(target.Countains("public")); Assert.IsFalse(target.Countains("PUBLIC")); Assert.IsFalse(target.Countains("VoiD")); Assert.IsFalse(target.Countains("void")); Assert.IsFalse(target.Countains("VOID")); Assert.IsFalse(target.Countains("mETHODnAME")); Assert.IsFalse(target.Countains("methodname")); Assert.IsFalse(target.Countains("METHODNAME")); }