Esempio n. 1
0
        public void ReadingXmlFileTest_EmptyFile()
        {
            string expectedValue = string.Empty;

            Exercise3.DTO.ExerciceFile f = new DTO.ExerciceFile()
            {
                Path = @"Data\TestFile2.xml"
            };
            var    service         = new FileServices(f);
            string calculatedValue = service.ReadFile();

            Assert.AreEqual(calculatedValue, expectedValue);
        }
Esempio n. 2
0
        public void ReadingTxtFileTest_TypeERROR()
        {
            string expectedValue = "ERROR EXTENSION";

            Exercise3.DTO.ExerciceFile f = new DTO.ExerciceFile()
            {
                Path = @"Data\TestFile3.csv"
            };
            var    service         = new FileServices(f);
            string calculatedValue = service.ReadFile();

            Assert.AreEqual(calculatedValue, expectedValue);
        }
Esempio n. 3
0
        public void ReadingXmlFileTest_Success()
        {
            string expectedValue = "<test>ceci est un test de lecture</test>";

            Exercise3.DTO.ExerciceFile f = new DTO.ExerciceFile()
            {
                Path = @"Data\TestFile1.xml"
            };
            var    service         = new FileServices(f);
            string calculatedValue = service.ReadFile();

            Assert.AreEqual(calculatedValue, expectedValue);
        }
Esempio n. 4
0
        public void ReadingTxtFileTest_Success()
        {
            string expectedValue = "Ceci est un test de lecture d'un fichier .txt";

            Exercise3.DTO.ExerciceFile f = new DTO.ExerciceFile()
            {
                Path = @"Data\TestFile1.txt"
            };
            var    service         = new FileServices(f);
            string calculatedValue = service.ReadFile();

            Assert.AreEqual(calculatedValue, expectedValue);
        }