Exemplo n.º 1
0
        public void GetNamesFromFileByDate_FileNotFound_ThrowsException()
        {
            Exception ex = Assert.Throws <Exception>(() =>
                                                     Filereader.GetNamesFromFileByDate("2.9.",
                                                                                       Path.Combine(
                                                                                           Directory.GetCurrentDirectory(),
                                                                                           "asdasd.dsa")));

            Assert.Equal("File not found.", ex.Message);
        }
Exemplo n.º 2
0
        public void GetNamesFromFileByDate_FileFound_ReturnsName()
        {
            var result =
                Filereader.GetNamesFromFileByDate("2.9.",
                                                  Path.Combine(
                                                      Directory.GetCurrentDirectory(),
                                                      "nimet.csv"));

            Assert.Equal("Sinikka, Sini, Justus", result);
        }
Exemplo n.º 3
0
        public void GetNamesFromFileByDate_FileFormatWrong_ThrowsException()
        {
            Exception ex = Assert.Throws <Exception>(() =>
                                                     Filereader.GetNamesFromFileByDate("2.9.",
                                                                                       Path.Combine(
                                                                                           Directory.GetCurrentDirectory(),
                                                                                           "NameDay.pdb")));

            Assert.Equal("File is in incorrect format.", ex.Message);
        }