コード例 #1
0
        public void GetHorses_FromXmlFile_FileNotFoundException()
        {
            var    fileParser = new XmlFileParser();
            string path       = "TestData/DoesNotExist.xml";

            Assert.Throws <FileNotFoundException>(() => fileParser.GetHorseDetails(path));
        }
コード例 #2
0
        public void GetHorseDetails_Fail_Case1()
        {
            var    fileParser = new XmlFileParser();
            string path       = "TestData/DoesNotExist.json";

            Assert.Throws <FileNotFoundException>(() => fileParser.GetHorseDetails(path));
        }
コード例 #3
0
        public void GetHorseDetails_Success_Case1()
        {
            var    fileParser = new XmlFileParser();
            string path       = "TestData/Caulfield_Race1.xml";
            var    horses     = fileParser.GetHorseDetails(path);

            Assert.NotNull(horses);
            Assert.True(horses.Count > 0);
        }
コード例 #4
0
        public void GetHorseDetails_Fail_Case1()
        {
            var    fileParser = new XmlFileParser();
            string path       = "TestData/IncompleXml.xml";
            var    horses     = fileParser.GetHorseDetails(path);

            Assert.NotNull(horses);
            Assert.True(horses.Count == 0);
        }