示例#1
0
        public void TestGetCorrectValueAsString()
        {
            ApiJsonStarshipsParser parser = new ApiJsonStarshipsParser(jsonStringWithAllDataMonth, mockLogger.Object);
            string result = parser.GetPropertyAsString("next");

            Assert.Equal("next_value", result);
        }
示例#2
0
        public void TestGetIncorrectValueAsString()
        {
            ApiJsonStarshipsParser parser = new ApiJsonStarshipsParser(jsonStringWithoutValue, mockLogger.Object);

            Assert.Throws <KeyNotFoundException> (() => {
                string result = parser.GetPropertyAsString("next");
            });
        }