Пример #1
0
        public async Task TestThatGetEmployeeWithIdWorks()
        {
            //send request to the server to /employee/id/#id
            string id = "5";
            HttpResponseMessage response = await _client.GetAsync(urlemploeesId + id);

            //Verify that the we have OK status code
            Assert.AreEqual(response.StatusCode, HttpStatusCode.OK, "Sorry, the response status is NotOK");

            //Compare the the response from the HttpClient and the XML to have all the right data
            dynamic JSONresp = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
            bool    comp     = Comparisons.ContainsCorrectObject(JSONresp, xdoc);

            Assert.IsTrue(comp, "XML objects and respnse object are not equal");
        }