Beispiel #1
0
        public void CallApiAsync_Error()
        {
            _mockServer.AddRequest("GET", TestPath)
            .AddJsonResponse("", 400);     // supposed to fail here
            var exception = Assert.ThrowsAsync <IcException>(() =>
                                                             BuildApiFacade(ErrorDictionary)
                                                             .CallJsonToJsonApi(_mockServer.GetUrl(TestPath), "GET"));

            TestingUtils.AssertStringContainsValues(exception.Message, DefaultErorMessage, DefaultErrorCode);
        }
Beispiel #2
0
        public void DictionaryToJson_IncludeNulls()
        {
            var dictionary = new Dictionary <string, string>
            {
                { "a", null }
            };

            var json = new JsonConvertFacade().DictionaryToJson(dictionary);

            TestingUtils.AssertStringContainsValues(json, "a", "null");
        }