public void CreateContext_UnauthorizedRequestTest() { HttpServiceMock mock = new HttpServiceMock(); mock.Path = "api/v2/users/username"; mock.HttpMethod = HttpMethod.Get; mock.Content = null; mock.HttpResponse = new HttpResponse("Unauthorized", null); Context invalidContext = new Context("https://api.sentinelapp.com.br", "invalid", "invalid"); invalidContext.HttpService = mock; invalidContext.FindUser("username"); }
private HttpServiceMock createHttpServiceMock(string path, HttpMethod httpMethod, string content, string statusCode, string response) { HttpServiceMock mock = new HttpServiceMock(); mock.Path = path; mock.HttpMethod = httpMethod; mock.Content = content; mock.HttpResponse = new HttpResponse(statusCode, response); return mock; }