예제 #1
0
        public void SearchAndSort_SearchSortThenSearchAgain_SearchResultIsTheSame()
        {
            // Arrange
            var file      = new TxtFile(Path.Combine(Directory.GetCurrentDirectory(), @"ExampleFiles\ValidTxtFile.txt"));
            int searchOne = file.Search("baloo");

            file.SortWords();
            int searchTwo = file.Search("baloo");

            // Assert
            Assert.AreEqual(searchOne, searchTwo);
        }
예제 #2
0
        public void Search_WordIsNotInFile_ReturnsRightOccurance()
        {
            // Arrange
            var file = new TxtFile(Path.Combine(Directory.GetCurrentDirectory(), @"ExampleFiles\ValidTxtFile.txt"));

            // Assert
            Assert.AreEqual(0, file.Search("kuckeliku"));
        }