public void GivenNullFilePath_WhenGetHorsesCalled_ThenReturnEmptyList() { var xmlFileParser = new XmlFileParser(); var horses = xmlFileParser.GetHorses(null); Assert.True(horses.Count() == 0); }
public void GivenXMLFilePath_WhenGetHorsesCalled_ThenReturnListOfHorses() { var xmlFileParser = new XmlFileParser(); var horses = xmlFileParser.GetHorses(@"TestData\Caulfield_Race1.xml"); Assert.NotNull(horses); Assert.True(horses.Count() > 0); }
public void GivenPathToTextFile_WhenGetHorsesCalled_ThenExceptionThrown() { var xmlFileParser = new XmlFileParser(); Assert.Throws <InvalidOperationException>(() => xmlFileParser.GetHorses(@"TestData\TextFile1.txt")); }
public void GivenInvalidFilePath_WhenGetHorsesCalled_ThenExceptionThrown() { var xmlFileParser = new XmlFileParser(); Assert.Throws <FileNotFoundException>(() => xmlFileParser.GetHorses(@"TestData\test.xml")); }