public void AreAnagrams_ContainNonAlphaNumeric_ThrowsArgumentException() { // arrange var anagramCheck = new Anagram(); // acts & assert Assert.Throws <ArgumentException>(() => anagramCheck.AreAnagrams("a$", "a$")); }
public void AreAnagrams_NullWord_ThrowsInvalidateArgumentException(string word1, string word2) { // arrange var anagramCheck = new Anagram(); // act & assert Assert.Throws <ArgumentNullException>(() => anagramCheck.AreAnagrams(word1, word2)); }
public void AreAnagrams_SameStrings_ReturnsTrue() { // arrange var anagramCheck = new Anagram(); // act var result = anagramCheck.AreAnagrams("abc", "abc"); //assert Assert.True(result); }
public void AreAnagrams_SameLettersDifferentLength_ReturnsFalse(string word1, string word2) { // arrange var anagramCheck = new Anagram(true); // act var result = anagramCheck.AreAnagrams(word1, word2); //assert Assert.False(result); }
public void AreAnagrams_WordsWithLettersReversed_ReturnsTrue(string word1, string word2) { // arrange var anagramCheck = new Anagram(); // act var result = anagramCheck.AreAnagrams(word1, word2); //assert Assert.True(result); }
public void AreAnagrams_ShareNoLetters_ReturnsFalse(string word1, string word2) { // arrange var anagramCheck = new Anagram(); // act var result = anagramCheck.AreAnagrams(word1, word2); //assert Assert.False(result); }
public void AreAnagrams_SameWordsMixedCase_DefaultConstructor_ReturnsFalse(string word1, string word2) { // arrange var anagramCheck = new Anagram(); // act var result = anagramCheck.AreAnagrams(word1, word2); //assert Assert.False(result); }
public void AreAnagrams_AnagramDifferentCase_IgnoreCaseFalse_ReturnsFalse(string word1, string word2) { // arrange var anagramCheck = new Anagram(false); // act var result = anagramCheck.AreAnagrams(word1, word2); //assert Assert.False(result); }
public void AreAnagrams_MismatchedWhitespace_ReturnsFalse(string word1, string word2) { // arrange var anagramCheck = new Anagram(); // act var result = anagramCheck.AreAnagrams(word1, word2); //assert Assert.False(result); }
public void Word1_IsRequired() { Assert.Throws <ArgumentException>(() => _anagram.AreAnagrams(string.Empty, "ABC")); }
public void ReturnFalseForNullWords() { Assert.False(_anagram.AreAnagrams(null, "", 0)); Assert.False(_anagram.AreAnagrams("", null, 0)); Assert.False(_anagram.AreAnagrams(null, null, 0)); }