Exemplo n.º 1
0
        public void Returns_Zero_Count_For_InValid_Content()
        {
            //Arrange
            IBook validBook = new MockBookManager() { Content = "&*$*££." };
            var _author = new Author(validBook);

            //Act
            var repeatedWordInfo = _author.GetRepeatedWordInfo();
            //Assert
            Assert.AreEqual(0, repeatedWordInfo.Count());
        }
Exemplo n.º 2
0
        public void Returns_Count_Without_Any_Special_Characters()
        {
            //Arrange
            IBook validBook = new MockBookManager() { Content = "This is a &&&*^ simple Text" };
            var _author = new Author(validBook);

            //Act
            var repeatedWordInfo = _author.GetRepeatedWordInfo();
            //Assert
            Assert.AreEqual(5, repeatedWordInfo.Count());
        }
Exemplo n.º 3
0
        public void Returns_Count_For_Valid_Content()
        {
            //Arrange
            IBook validBook = new MockBookManager() { Content = "This is a statement, and so is this." };
            var _author = new Author(validBook);

            //Act
            var repeatedWordInfo = _author.GetRepeatedWordInfo();
            //Assert
            Assert.AreEqual(6, repeatedWordInfo.Count());
        }
Exemplo n.º 4
0
        public void Returns_No_Items_when_Item_Not_Found()
        {
            //Arrange
            IBook validBook = new MockBookManager() { Content = "This is a statement, and so is this." };
            var _author = new Author(validBook);

            //Act
            var repeatedWordInfo = _author.GetRepeatedWordCount();
            var word = repeatedWordInfo.Find(v => v.Item1 == "Test");

            //Assert

            Assert.IsNull(word);
        }
Exemplo n.º 5
0
        public void Returns_Exact_Count_Of_Words()
        {
            //Arrange
            IBook validBook = new MockBookManager() { Content = "This is a statement, and so is this." };
            var _author = new Author(validBook);

            //Act
            var repeatedWordInfo = _author.GetRepeatedWordCount();
            var word = repeatedWordInfo.Find(v => v.Item1 == "this");

            //Assert

            Assert.IsNotNull(word);
            Assert.AreEqual(2,word.Item2);
        }