示例#1
0
        public async Task TestThatGetAllEmployeesWorks()
        {
            //send request to the server to /employee
            HttpResponseMessage response = await _client.GetAsync(urlemploees);

            //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 data
            dynamic JSONresp = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
            bool    comp     = Comparisons.ContainsMany(JSONresp, xdoc);

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