public void CreateBugs_ListBugsByFilter_ShouldReturnsBugsCorrectly() { // Arrange -> prepare a few bugs TestingEngine.CleanDatabase(); var httpResponseBug1 = TestingEngine.SubmitBugHttpPost("First Bug", null); Assert.AreEqual(HttpStatusCode.Created, httpResponseBug1.StatusCode); var submittedBug = httpResponseBug1.Content.ReadAsAsync <BugModel>().Result; var httpPatchResponse = TestingEngine.EditBugHttpPatch( submittedBug.Id, null, null, "Fixed"); Assert.AreEqual(HttpStatusCode.OK, httpPatchResponse.StatusCode); Thread.Sleep(2); var httpResponseBug2 = TestingEngine.SubmitBugHttpPost("Second Bug", "Second Description"); Assert.AreEqual(HttpStatusCode.Created, httpResponseBug2.StatusCode); Thread.Sleep(2); var httpResponseBug3 = TestingEngine.SubmitBugHttpPost("Strange Issue", null); Assert.AreEqual(HttpStatusCode.Created, httpResponseBug3.StatusCode); Thread.Sleep(2); // Act -> filter bugs var httpResponseFilterBugs = TestingEngine.FilterBugsHttpGet("Bug", "Fixed|Open", null); Assert.AreEqual(HttpStatusCode.OK, httpResponseFilterBugs.StatusCode); // Assert -> list the bugs and assert their count, order and content are correct var bugsFromService = httpResponseFilterBugs.Content.ReadAsAsync <List <BugModel> >().Result; Assert.AreEqual(2, bugsFromService.Count()); Assert.AreEqual("Second Bug", bugsFromService[0].Title); Assert.AreEqual("First Bug", bugsFromService[1].Title); }