public void TestAnagram() { Anagram anagram = new Anagram(); string wordFirst = "joseph"; string wordSecond = "hespoj"; Assert.AreEqual(true, anagram.IsAnagram(wordFirst, wordSecond)); }
public void TestIsAnagramWithOneString() { string one = "hello"; string two = ""; bool output = false; Assert.AreEqual(output, Anagram.IsAnagram(one, two)); }
public void TestIsAnagramWithSpace() { string one = "hello"; string two = "oll eh"; bool output = true; Assert.AreEqual(output, Anagram.IsAnagram(one, two)); }
public void TestIsAnagramWithUpperAndLowerCase() { string one = "Hello"; string two = "oLleh"; bool output = true; Assert.AreEqual(output, Anagram.IsAnagram(one, two)); }
public void Check_CasaAnagrams() { string path = @"E:\Proyectos\Kata\Anagram\file.txt"; string data = "casa"; string result = "aacs"; var anagram = new Anagram(path); string helper = anagram.OrderedWord(data); Assert.AreEqual(result, helper); }
public void TwoNullTextsAreRejected() { try { Anagram.IsAnagram(null, null); Assert.Fail("expected exception not thrown"); } catch (ArgumentNullException ex) { Assert.AreEqual("text1", ex.ParamName); } }
public void NullText2IsRejected() { try { Anagram.IsAnagram("valid", null); Assert.Fail("expected exception not thrown"); } catch (ArgumentNullException ex) { Assert.AreEqual("text2", ex.ParamName); } }
private static void AssertNullTextIsRejected(string[] example) { var text1 = example[0]; var text2 = example[1]; try { Anagram.IsAnagram(text1, text2); Assert.Fail("expected exception not thrown"); } catch (ArgumentNullException ex) { Assert.AreEqual("text" + (text1 == null ? "1" : "2"), ex.ParamName); } }
public void ShouldLettersBeAnagrams(string a, string b) { var anagram = new Anagram(); anagram.IsAnagram(a, b).ShouldBe(true); }
public void ShouldWordsNotBeAnagrams(string a, string b) { var anagram = new Anagram(); anagram.IsAnagram(a, b).ShouldBe(false); }
public void IdenticalTextWithSpacesIsNotAnAnagram() { Assert.IsFalse(Anagram.IsAnagram("same but with spaces", "same but with spaces")); }
public void IdenticalShortTextIsNotAnAnagram() { Assert.IsFalse(Anagram.IsAnagram("same", "same")); }
public void AssertIdenticalTextIsNotAnAnagram(string same) { Assert.IsFalse(Anagram.IsAnagram(same, same)); }