Ejemplo n.º 1
0
        public void GetHighestNumberTest()
        {
            FileStatisticsHandler statistics = new FileStatisticsHandler();

            int number = statistics.GetHighestNumber(@"inputFiles\simple.txt", out List <int> lines);

            Assert.AreEqual(10, number, "The number is incorrect");
            Assert.AreEqual(1, lines[0], "The line number is incorrect");
        }
Ejemplo n.º 2
0
        public void GetHighestNumberDuplicateTest()
        {
            FileStatisticsHandler statistics = new FileStatisticsHandler();

            int number = statistics.GetHighestNumber(@"inputFiles\duplicate.txt", out List <int> lines);

            Assert.AreEqual(10, number, "The number is incorrect");
            Assert.AreEqual(1, lines[0], "The first line number is incorrect");
            Assert.AreEqual(3, lines[1], "The second line number is incorrect");
        }
 public void ReadFileNegativeTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\negativeNumber.txt");
 }
 public void ReadFileOverflowTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\numberTooBig.txt");
 }
 public void ReadFileFileNotFoundTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\fileNotFound.txt");
 }
 public void ReadFileNoFilenameTest()
 {
     FileStatisticsHandler.ReadFile(string.Empty);
 }
 public void ReadFileEmptyLineTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\emptyLine.txt");
 }
 public void ReadFileIncorrectSeparatorTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\incorrectSeparator.txt");
 }
 public void ReadFileStringTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\string.txt");
 }
 public void ReadFileDecimalTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\decimalNumber.txt");
 }
 public void GetHighestNumberEmptyFileTest()
 {
     FileStatisticsHandler.ReadFile(@"inputFiles\emptyfile.txt");
 }