public void GetAccountDetailsTest() { var testJObject = new JObject() { new JProperty("statusCode", "0"), new JProperty("message", "Success"), }; var messageHandler = new FakeHttpMessageHandler(new HttpResponseMessage() { StatusCode = HttpStatusCode.OK, Content = new StringContent(JsonConvert.SerializeObject(testJObject), Encoding.UTF8, "application/json") }); var mockServiceClient = new MockServiceClient(messageHandler); var mockGraphService = new MockGraphService(); var mockB2CGraphService = new MockB2CGraphService(); var serviceId = new ServiceId(mockGraphService, mockB2CGraphService, _mockServiceClientServiceId); var accountDetails = new AccountDetails(serviceId, mockServiceClient); var input = new JObject() { new JProperty("token", "abc123"), new JProperty("serviceUrl", ServiceUrl.Url) }; var expectedOutput = new JObject() { new JProperty("statusCode", "0"), new JProperty("message", "Success") }; var response = accountDetails.GetAccountDetails(input); var responseObj = JObject.Parse(response); foreach (var item in responseObj) { Assert.True(expectedOutput.ContainsKey(item.Key)); var value = expectedOutput.GetValue(item.Key); Assert.Equal(value, item.Value); } }