示例#1
0
        public void Load_InvalidJsonFile_ExpectExceptionThrown()
        {
            //Arrange
            //Incorect path set
            JsonExtractor.JsonExtractor jsonExtractor = new JsonExtractor.JsonExtractor();
            var jsonFilePath = (@"TestData\InvalidJSON.json");

            //Act
            var testList = jsonExtractor.LoadJson(jsonFilePath);

            //Assert above method - Expected exception is set
        }
示例#2
0
        public void Load_JSONFile_Expect_TwoItemInList()
        {
            //Arrange
            JsonExtractor.JsonExtractor jsonExtractor = new JsonExtractor.JsonExtractor();
            var jsonFilePath = (@"TestData\ValidJSON.json");

            //Act
            var testList = jsonExtractor.LoadJson(jsonFilePath);

            //Assert
            Assert.AreEqual(testList.Count, 2);
        }
示例#3
0
        //This test has for only purpose to check if the the list has been populater correctly from the file
        public void Load_JSONFile_Expect_CorrectHorsesNames()
        {
            //Arrange
            JsonExtractor.JsonExtractor jsonExtractor = new JsonExtractor.JsonExtractor();
            var jsonFilePath = (@"TestData\ValidJSON.json");

            //Act
            var testList = jsonExtractor.LoadJson(jsonFilePath);

            //Assert

            Assert.AreEqual(testList[0].Name, "Toolatetodelegate");
            Assert.AreEqual(testList[1].Name, "Fikhaar");
        }