public async void TestGetQuestion_returns_valid_response() { var getQuestionEndpoint = "questions/{0}"; var result = await _restfulHelper.GetAsync(String.Format(_domainProductionApiDomain + getQuestionEndpoint, _testQuestionId)); Assert.IsNotNull(result); Assert.IsTrue(result.Contains("\"id\":\"" + _testQuestionId + "\"")); }
public async void TestGetQuestion_returns_valid_care_advice_AdultAge() { var getQuestionEndpoint = "pathways/care-advice/43/Female?markers=Cx220179"; var result = await _restfulHelper.GetAsync(String.Format(_BusinessdomainApiDomain + getQuestionEndpoint)); //this checks a responce is returned Assert.IsNotNull(result); //these check the right fields are returned Assert.IsTrue(result.Contains("\"id")); Assert.IsTrue(result.Contains("\"title")); Assert.IsTrue(result.Contains("\"excludeTitle")); Assert.IsTrue(result.Contains("\"items")); //these check the wrong fields are not returned AssertValidResponseSchema(result, ResponseSchemaType.Answer); //this next one checks the right question has returned Assert.IsTrue(result.Contains("\"id\":\"Cx220179-Adult-Female")); Assert.IsTrue(result.Contains("\"title\":\"Needlestick injury")); }
public async void BusinessApiTests_returns_valid_Pathway_Numbers() { var getQuestionEndpoint = "/Female/16"; var result = await _restfulHelper.GetAsync(String.Format(BusinessApiPathwayUrl + getQuestionEndpoint, _testPathwayNo2)); //this checks a responce is returned Assert.IsNotNull(result); //these check the right fields are returned SchemaValidation.AssertValidResponseSchema(result, SchemaValidation.ResponseSchemaType.Pathway); //this next one checks the right question has returned Assert.IsTrue(result.Contains("\"title\":\"Headache")); Assert.IsTrue(result.Contains("\"gender\":\"Female")); Assert.IsTrue(result.Contains("\"pathwayNo\":\"PW752")); }
public async void TestGetQuestion_returns_valid_nodeId_response() { var getQuestionEndpoint = "node/{0}/next_node/{1}/answer/yes?state=%7B%22PATIENT_AGE%22%3A%2222%22%7D"; var result = await _restfulHelper.GetAsync(String.Format(_BusinessdomainApiDomain + getQuestionEndpoint, _testPathwayId2, _expectedNodeId)); Assert.IsNotNull(result); //these check the right fields are returned AssertValidResponseSchema(result, ResponseSchemaType.Question); Assert.IsTrue(result.Contains("\"id\":\"PW758.0")); }