コード例 #1
0
        public void GetContentAsObject_WhenContentIsValidJson_ReturnObject()
        {
            HttpClientResponse response = new HttpClientResponse("{Property1: 1, Property2: '2', Property3: {SubProperty1: 1}}", new Dictionary <string, string>(), true);

            MockResponseModel model = response.GetContentAsObject <MockResponseModel>();

            Assert.AreEqual(1, model.Property1);
            Assert.AreEqual("2", model.Property2);
            Assert.AreEqual(1, model.Property3.SubProperty1);
        }