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

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

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