public void TestShouldThrowFileNotFoundExceptionIfFileNotExists() { var fileReader = new SimpleFileReader(); string inputFilePath = Path.Combine("TestData", DateTime.Now.ToShortDateString()); Assert.Throws(typeof(FileNotFoundException), () => fileReader.Read(inputFilePath)); }
public void TestShouldReadFileAndReturnAllLines() { var fileReader = new SimpleFileReader(); string inputFilePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData\\testinput.txt"); IEnumerable <string> inputLines = fileReader.Read(inputFilePath); Assert.AreEqual(5, inputLines.Count()); }
public void YmnosGroupTest_ValidIhos() { string folderPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData"); var reader = new SimpleFileReader(folderPath); string xml = reader.Read("YmnosGroupTest.xml"); TypiconSerializer ser = new TypiconSerializer(); YmnosGroup element = ser.Deserialize <YmnosGroup>(xml); Assert.IsTrue(element.IsValid); }