public void Add_ValidWordArgument_TrueAndChangeAnagramRest(string anagram, string word, string expectedAnagramRest) { var anagramMatchTracker = new AnagramMatchTracker(anagram); Assert.True(anagramMatchTracker.Add(word)); Assert.AreEqual(expectedAnagramRest, anagramMatchTracker.AnagramRest); }
public void Add_InvalidWordArgument_FalseAndUnchangedAnagramRest(string word) { var anagramMatchTracker = new AnagramMatchTracker("anagram"); var existingAnagramRest = anagramMatchTracker.AnagramRest; Assert.False(anagramMatchTracker.Add(word)); Assert.AreEqual(existingAnagramRest, anagramMatchTracker.AnagramRest); }
public void Remove_AddWordAndRemoveItAgain_AnagramRestSame(string anagram, string word, string expectedAnagramRest) { var anagramMatchTracker = new AnagramMatchTracker(anagram); anagramMatchTracker.Add(word); anagramMatchTracker.Remove(); Assert.AreEqual(expectedAnagramRest, anagramMatchTracker.AnagramRest); }
public void Constructor_ValidAnagramArgument_NewInstance() { var anagramMatchTracker = new AnagramMatchTracker("anagram"); Assert.NotNull(anagramMatchTracker); Assert.AreEqual(0, anagramMatchTracker.Count); Assert.False(anagramMatchTracker.IsAnagramRestEmpty); }
public void Remove_FullAnagramRest_InvalidOperationException() { var anagramMatchTracker = new AnagramMatchTracker("anagram"); Assert.Throws<InvalidOperationException>(() => anagramMatchTracker.Remove()); }
public void AnagramRest_NewInstanceWithValidAnagramArgument_AnagramRestWithWhitespaceRemoved(string anagram, string expectedAnagramRest) { var anagramMatchTracker = new AnagramMatchTracker(anagram); Assert.AreEqual(expectedAnagramRest, anagramMatchTracker.AnagramRest); }