Esempio n. 1
0
        public void IsValidAnagramTestWithEmptyInput()
        {
            IsAnagram IA     = new IsAnagram();
            Action    action = () => IA.IsValidAnagram(string.Empty, string.Empty);

            action.ShouldThrow <ArgumentException>();
        }
        public void IsAnagram()
        {
            IsAnagram angrm = new IsAnagram();

            Assert.True(angrm.Check("geeksforgeeks", "forgeeksgeeks"));
            Assert.False(angrm.Check("allergy", "allergic"));
        }
Esempio n. 3
0
        public void IsValidAnagramTestWithNullInput()
        {
            IsAnagram IA     = new IsAnagram();
            Action    action = () => IA.IsValidAnagram("rat", null);

            action.ShouldThrow <ArgumentException>();
        }
        public void GetResult_ShouldReturnCorrectResult(string s1, string s2, bool expectedResult)
        {
            // Arrange
            var sut = new IsAnagram();

            // Act
            var result = sut.GetResult(s1, s2);

            // Assert
            Assert.AreEqual(expectedResult, result, "Result is incorrect");
        }
Esempio n. 5
0
        public void IsValidAnagramTestWithequalStrings()
        {
            IsAnagram IA = new IsAnagram();

            IA.IsValidAnagram("rat", "rat").Should().Be(true);
        }
Esempio n. 6
0
        public void IsValidAnagramTestWithStringsOfDifferentLength()
        {
            IsAnagram IA = new IsAnagram();

            IA.IsValidAnagram("rat", "cats").Should().Be(false);
        }
Esempio n. 7
0
        public void IsValidAnagramNegativeTest()
        {
            IsAnagram IA = new IsAnagram();

            IA.IsValidAnagram("rat", "cat").Should().Be(false);
        }
Esempio n. 8
0
        public void IsValidAnagramTest()
        {
            IsAnagram IA = new IsAnagram();

            IA.IsValidAnagram("anagram", "nagaram").Should().Be(true);
        }
Esempio n. 9
0
 public void IsItAnagram_AnagramsPassed_ReturnsTrue()
 {
     Assert.IsTrue(IsAnagram.IsItAnagram("listen", "silent"));
 }
Esempio n. 10
0
 public void IsItAnagram_NonAnagramsPassed_ReturnsFalse()
 {
     Assert.IsFalse(IsAnagram.IsItAnagram("bob", "joe"));
 }
Esempio n. 11
0
 public void IsItAnagram_AnagramsPassed1_ReturnsTrue()
 {
     Assert.IsTrue(IsAnagram.IsItAnagram("abc", "cba"));
 }
Esempio n. 12
0
 public HomeController(IsAnagram anagramChecker)
 {
     AnagramChecker = anagramChecker;
 }