예제 #1
0
        public void TryAdd_ExistingAnagram_FalseReturned()
        {
            String word = "вертикаль";
            var anagram = new Anagram(word);

            Boolean value = anagram.TryAdd(word);

            Assert.IsFalse(value);
        }
예제 #2
0
        public void IsAnagram_MultipleWords_TrueReturned()
        {
            String word = "вертикаль", wordToAdd = "кильватер";
            var anagram = new Anagram(word);
            anagram.TryAdd(wordToAdd);

            Boolean value = anagram.IsAnagram;

            Assert.IsTrue(value);
        }
예제 #3
0
        public void TryAdd_ExistingAnagram_NoChangesMade()
        {
            String word = "вертикаль";
            var anagram = new Anagram(word);

            Boolean value = anagram.TryAdd(word);

            Assert.IsTrue(anagram.Count() == 1 && anagram.Contains(word));
        }
예제 #4
0
        public void TryAdd_NotAnagram_FalseReturned()
        {
            String word = "вертикаль", wordToAdd = "король";
            var anagram = new Anagram(word);

            Boolean value = anagram.TryAdd(wordToAdd);

            Assert.IsFalse(value);
        }
예제 #5
0
        public void TryAdd_NewAnagram_AnagramAdded()
        {
            String word = "вертикаль", wordToAdd = "кильватер";
            var anagram = new Anagram(word);

            Boolean value = anagram.TryAdd(wordToAdd);

            Assert.IsTrue(anagram.Count() == 2 && anagram.Contains(word) && anagram.Contains(wordToAdd));
        }