Example #1
0
        public void TestGetTopWords_FileContentsNull_ValueReturnedNull()
        {
            //Arrange
            fc = null;
            WordCount wc = new WordCount(fc);

            //Act
            var actual = wc.GetTopWords(2);

            //Assert
            Assert.IsNull(actual);
        }
Example #2
0
        public void TestGetTopWords_FileContentsNotBlankAndContainsValidWords_ValueReturned2Entries()
        {
            //Arrange
            WordCount wc = new WordCount(fc);

            //Act
            var actual   = wc.GetTopWords(2);
            var expected = new Dictionary <string, int> {
                { "aa", 4 }, { "bb", 3 }
            };

            //Assert
            CollectionAssert.AreEquivalent((ICollection)expected, (ICollection)actual);
        }