Esempio n. 1
0
        public void RegisterUser_InvalidUserData_ShouldReturn400_BadRequest()
        {
            // Arrange
            TestingEngine.CleanDatabase();

            // Act -> empty username
            var responseEmptyUsername = TestingEngine.RegisterUserHttpPost("", "#paSSw@rd12345");

            // Assert -> 400 (Bad Request)
            Assert.AreEqual(HttpStatusCode.BadRequest, responseEmptyUsername.StatusCode);

            // Act -> empty password
            var responseEmptyPassword = TestingEngine.RegisterUserHttpPost("maria", "");

            // Assert -> 400 (Bad Request)
            Assert.AreEqual(HttpStatusCode.BadRequest, responseEmptyPassword.StatusCode);

            // Act -> null username
            var responseNullUsername = TestingEngine.RegisterUserHttpPost(null, "#paSSw@rd12345");

            // Assert -> 400 (Bad Request)
            Assert.AreEqual(HttpStatusCode.BadRequest, responseNullUsername.StatusCode);

            // Act -> null password
            var responseNullPassword = TestingEngine.RegisterUserHttpPost("maria", null);

            // Assert -> 400 (Bad Request)
            Assert.AreEqual(HttpStatusCode.BadRequest, responseNullPassword.StatusCode);

            // Act -> no data (empty HTTP body)
            var httpResponse = TestingEngine.HttpClient.PostAsync("/api/user/register", null).Result;

            // Assert -> 400 (Bad Request)
            Assert.AreEqual(HttpStatusCode.BadRequest, httpResponse.StatusCode);
        }
Esempio n. 2
0
        public void DeleteBug_WithComments_ShouldReturn200Ok_RemoveTheBug()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();
            var bugTitle       = "Bug title";
            var bugDescription = "Bug description";

            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, bugDescription);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            var httpPostResponseFirstComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 1");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseFirstComment.StatusCode);

            var httpPostResponseSecondComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 2");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseSecondComment.StatusCode);

            // Act -> delete the bug by its ID
            var httpResponseDeleteBug = TestingEngine.HttpClient.DeleteAsync("/api/bugs/" + submittedBug.Id).Result;

            // Assert -> check if the bug by ID holds correct data
            Assert.AreEqual(HttpStatusCode.OK, httpResponseDeleteBug.StatusCode);

            var httpResponseGetBug = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id).Result;

            Assert.AreEqual(HttpStatusCode.NotFound, httpResponseGetBug.StatusCode);
        }
Esempio n. 3
0
        public void GetCommentsForNonExistingBug_ListComments_ShouldListNotFound404()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();

            // Act -> find all comments
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/941/comments").Result;

            // Assert -> check the http status
            Assert.AreEqual(HttpStatusCode.NotFound, httpResponse.StatusCode);
        }
Esempio n. 4
0
        public void Get_Comments_For_NonExisting_Bug_Should_Return404NotFound()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();

            // Act
            var response = TestingEngine.HttpClient.GetAsync("api/bugs/" + int.MaxValue + "/comments").Result;

            // Assert
            Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode);
        }
        public void TestGetCommentForBugWhenBugDontExistShouldReturnNotFound()
        {
            // Arrange -> clean database
            TestingEngine.CleanDatabase();

            // Act -> find all comments for the bug
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/1/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.NotFound, httpResponse.StatusCode);
        }
        public void ListBugComments_UnexistingBug_ShouldReturnNotFound()
        {
            // Arrange -> clean database
            TestingEngine.CleanDatabase();

            // Act -> find bug comments
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/1/comments").Result;

            // Assert -> check the returned status code
            Assert.AreEqual(HttpStatusCode.NotFound, httpResponse.StatusCode);
        }
Esempio n. 7
0
        public void UserLogin_InvalidUser_ShouldReturn400_BadRequest()
        {
            // Arrange
            TestingEngine.CleanDatabase();
            var username = "******";
            var password = "******";

            // Act
            var loginResponse = TestingEngine.LoginUserHttpPost(username, password);

            // Assert
            Assert.AreEqual(HttpStatusCode.BadRequest, loginResponse.StatusCode);
        }
Esempio n. 8
0
        public void RegisterUser_DuplicatedUsername_ShouldReturn400_BadRequest()
        {
            // Arrange
            TestingEngine.CleanDatabase();

            // Act
            var responseFirstRegistration  = TestingEngine.RegisterUserHttpPost("maria", "#paSSw@rd12345");
            var responseSecondRegistration = TestingEngine.RegisterUserHttpPost("maria", "0th3RPassw@rd");

            // Assert
            Assert.AreEqual(HttpStatusCode.OK, responseFirstRegistration.StatusCode);
            Assert.AreEqual(HttpStatusCode.BadRequest, responseSecondRegistration.StatusCode);
        }
Esempio n. 9
0
        public void GetBugById_ExistingBug_ShouldReturn200Ok_TheBugWithComments()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();
            var bugTitle       = "Bug title";
            var bugDescription = "Bug description";

            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, bugDescription);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            var httpPostResponseFirstComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 1");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseFirstComment.StatusCode);
            Thread.Sleep(2);

            var httpPostResponseSecondComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 2");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseSecondComment.StatusCode);

            // Act -> find the bug by its ID
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id).Result;

            // Assert -> check if the bug by ID holds correct data
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var bugFromService = httpResponse.Content.ReadAsAsync <BugModel>().Result;

            Assert.IsTrue(bugFromService.Id > 0);
            Assert.AreEqual(bugTitle, bugFromService.Title);
            Assert.AreEqual(bugDescription, bugFromService.Description);
            Assert.AreEqual(null, bugFromService.Author);
            Assert.AreEqual("Open", bugFromService.Status.ToString());
            Assert.IsTrue(bugFromService.DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));

            Assert.AreEqual(2, bugFromService.Comments.Count());

            Assert.IsTrue(bugFromService.Comments[0].Id > 0);
            Assert.AreEqual("Comment 2", bugFromService.Comments[0].Text);
            Assert.AreEqual(null, bugFromService.Comments[0].Author);
            Assert.IsTrue(bugFromService.Comments[0].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));

            Assert.IsTrue(bugFromService.Comments[1].Id > 0);
            Assert.AreEqual("Comment 1", bugFromService.Comments[1].Text);
            Assert.AreEqual(null, bugFromService.Comments[1].Author);
            Assert.IsTrue(bugFromService.Comments[1].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));
        }
        public void TestGetCommentForBugWhenBugExistAndThereAreCommentsShouldReturnCommentOrderedDescendingByDate()
        {
            // Arrange -> create a new bug with three comments
            TestingEngine.CleanDatabase();

            var bugTitle         = "bug title";
            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            var httpPostResponseFirstComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 1");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseFirstComment.StatusCode);
            Thread.Sleep(2);

            var httpPostResponseSecondComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 2");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseSecondComment.StatusCode);
            Thread.Sleep(2);

            var httpPostResponseThirdComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 3");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseThirdComment.StatusCode);

            // Act -> find all comments for the bug
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id + "/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var commentsFromService = httpResponse.Content.ReadAsAsync <List <CommentModel> >().Result;

            Assert.AreEqual(3, commentsFromService.Count());

            Assert.AreEqual("Comment 3", commentsFromService[0].Text);
            Assert.AreEqual(null, commentsFromService[0].Author);
            Assert.IsTrue(commentsFromService[0].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));

            Assert.AreEqual("Comment 2", commentsFromService[1].Text);
            Assert.AreEqual(null, commentsFromService[1].Author);
            Assert.IsTrue(commentsFromService[1].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));

            Assert.AreEqual("Comment 1", commentsFromService[2].Text);
            Assert.AreEqual(null, commentsFromService[2].Author);
            Assert.IsTrue(commentsFromService[2].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));
        }
Esempio n. 11
0
        public void CreateBugWithUserComments_ListComments_ShouldListCommentsCorrectly()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();

            var bugTitle         = "bug title";
            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            var userSession = TestingEngine.RegisterUser("pepo", "pepo");

            TestingEngine.HttpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + userSession.Access_Token);

            var httpPostResponseFirstComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 1");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseFirstComment.StatusCode);
            Thread.Sleep(2);

            var httpPostResponseSecondComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 2");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseSecondComment.StatusCode);

            TestingEngine.HttpClient.DefaultRequestHeaders.Remove("Authorization");

            // Act -> find all comments
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id + "/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var commentsFromService = httpResponse.Content.ReadAsAsync <List <CommentModel> >().Result;

            Assert.AreEqual(2, commentsFromService.Count());

            Assert.IsTrue(commentsFromService[0].Id > 0);
            Assert.AreEqual("Comment 2", commentsFromService[0].Text);
            Assert.AreEqual("pepo", commentsFromService[0].Author);
            Assert.IsTrue(commentsFromService[0].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));

            Assert.IsTrue(commentsFromService[1].Id > 0);
            Assert.AreEqual("Comment 1", commentsFromService[1].Text);
            Assert.AreEqual("pepo", commentsFromService[1].Author);
            Assert.IsTrue(commentsFromService[1].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));
        }
Esempio n. 12
0
        public void CreateBugs_ListBugs_ShouldListCreatedBugsCorrectly()
        {
            // Arrange -> prepare a few bugs
            TestingEngine.CleanDatabase();
            var bugsToAdds = new BugModel[]
            {
                new BugModel()
                {
                    Title = "First Bug"
                },
                new BugModel()
                {
                    Title = "Second Bug", Description = "More info"
                },
                new BugModel()
                {
                    Title = "Third Bug"
                }
            };

            // Act -> submit a few bugs
            foreach (var bug in bugsToAdds)
            {
                var httpPostResponse = TestingEngine.SubmitBugHttpPost(bug.Title, bug.Description);
                Thread.Sleep(2);

                // Assert -> ensure each bug is successfully submitted
                Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            }

            // Assert -> list the bugs and assert their count, order and content are correct
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs").Result;

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);

            var bugsFromService = httpResponse.Content.ReadAsAsync <List <BugModel> >().Result;

            Assert.AreEqual(bugsToAdds.Count(), bugsFromService.Count);

            var reversedAddedBugs = bugsToAdds.Reverse().ToList();

            for (int i = 0; i < reversedAddedBugs.Count; i++)
            {
                Assert.IsTrue(bugsFromService[i].Id != 0);
                Assert.AreEqual(reversedAddedBugs[i].Title, bugsFromService[i].Title);
            }
        }
Esempio n. 13
0
        public void UserLogin_ValidUser_ShouldReturn200Ok_AccessToken()
        {
            // Arrange
            TestingEngine.CleanDatabase();
            var username = "******";
            var password = "******";

            // Act
            var userSessionRegister = TestingEngine.RegisterUser(username, password);
            var userSessionLogin    = TestingEngine.LoginUser(username, password);

            // Assert
            Assert.AreEqual(username, userSessionRegister.UserName);
            Assert.AreEqual(username, userSessionLogin.UserName);
            Assert.AreEqual(userSessionLogin.UserName, userSessionRegister.UserName);
            Assert.AreNotEqual(userSessionLogin.Access_Token, userSessionRegister.Access_Token);
        }
Esempio n. 14
0
        public void CreateBugWithComments_ListAllComments_ShouldListCommentsCorrectly()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();

            var bugTitle         = "bug title";
            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            var httpPostResponseFirstComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 1");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseFirstComment.StatusCode);
            Thread.Sleep(2);

            var httpPostResponseSecondComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 2");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseSecondComment.StatusCode);

            // Act -> find all comments
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var commentsFromService = httpResponse.Content.ReadAsAsync <List <CommentModel> >().Result;

            Assert.AreEqual(2, commentsFromService.Count());

            Assert.IsTrue(commentsFromService[0].Id > 0);
            Assert.AreEqual("Comment 2", commentsFromService[0].Text);
            Assert.AreEqual(null, commentsFromService[0].Author);
            Assert.IsTrue(commentsFromService[0].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));
            Assert.AreEqual(submittedBug.Id, commentsFromService[0].BugId);
            Assert.AreEqual(bugTitle, commentsFromService[0].BugTitle);

            Assert.IsTrue(commentsFromService[1].Id > 0);
            Assert.AreEqual("Comment 1", commentsFromService[1].Text);
            Assert.AreEqual(null, commentsFromService[1].Author);
            Assert.IsTrue(commentsFromService[1].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));
            Assert.AreEqual(submittedBug.Id, commentsFromService[1].BugId);
            Assert.AreEqual(bugTitle, commentsFromService[1].BugTitle);
        }
        public void ListBugComments_NoComments_ShouldReturnEmptyArray()
        {
            // Arrange -> clean database and add a bug
            TestingEngine.CleanDatabase();
            var httpPostResponse = TestingEngine.SubmitBugHttpPost("title007", null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            // Act -> find bug comments
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id + "/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var commentsFromService = httpResponse.Content.ReadAsAsync <List <CommentModel> >().Result;

            Assert.AreEqual(0, commentsFromService.Count());
        }
Esempio n. 16
0
        public void CreateBug_ListComments_ShouldEmptyListCommentsCorrectly()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();

            var bugTitle         = "bug title";
            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            // Act -> find all comments
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id + "/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var commentsFromService = httpResponse.Content.ReadAsAsync <List <CommentModel> >().Result;

            Assert.AreEqual(0, commentsFromService.Count());
        }
        public void TestGetCommentForBugWhenBugExistAndThereAreNoCommentsShouldReturnNoComments()
        {
            // Arrange -> create a new bug
            TestingEngine.CleanDatabase();

            var bugTitle         = "bug title";
            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            // Act -> find all comments for the bug
            var httpResponse = TestingEngine.HttpClient.GetAsync("/api/bugs/" + submittedBug.Id + "/comments").Result;

            // Assert -> check the returned comments
            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var commentsFromService = httpResponse.Content.ReadAsAsync <List <CommentModel> >().Result;

            Assert.AreEqual(0, commentsFromService.Count());
        }
Esempio n. 18
0
        public void Get_Comments_For_Existing_GivenBug_Should_Return200Ok_And_All_Comments()
        {
            // Arrange -> create a new bug with two comments
            TestingEngine.CleanDatabase();

            var bugTitle         = "bug title";
            var httpPostResponse = TestingEngine.SubmitBugHttpPost(bugTitle, null);

            Assert.AreEqual(HttpStatusCode.Created, httpPostResponse.StatusCode);
            var submittedBug = httpPostResponse.Content.ReadAsAsync <BugModel>().Result;

            var httpPostResponseFirstComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 1");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseFirstComment.StatusCode);
            Thread.Sleep(2);

            var httpPostResponseSecondComment =
                TestingEngine.SubmitCommentHttpPost(submittedBug.Id, "Comment 2");

            Assert.AreEqual(HttpStatusCode.OK, httpPostResponseSecondComment.StatusCode);

            // Act
            var response = TestingEngine.HttpClient.GetAsync("api/bugs/" + submittedBug.Id + "/comments").Result;

            // Assert
            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);

            var commentsFromService = response.Content.ReadAsAsync <List <BugDetailsCommentViewModel> >().Result;

            Assert.AreEqual(2, commentsFromService.Count);
            Assert.IsTrue(commentsFromService[0].Id > 0);
            Assert.AreEqual("Comment 2", commentsFromService[0].Text);
            Assert.AreEqual(null, commentsFromService[0].Author);
            Assert.IsTrue(commentsFromService[0].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));

            Assert.IsTrue(commentsFromService[1].Id > 0);
            Assert.AreEqual("Comment 1", commentsFromService[1].Text);
            Assert.AreEqual(null, commentsFromService[1].Author);
            Assert.IsTrue(commentsFromService[1].DateCreated - DateTime.Now < TimeSpan.FromMinutes(1));
        }
Esempio n. 19
0
        public void RegisterUser_EmptyDb_ShouldReturn200Ok_AccessToken()
        {
            // Arrange
            TestingEngine.CleanDatabase();
            var username = "******";

            // Act
            var postContent = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("username", username),
                new KeyValuePair <string, string>("password", "pAssW@rd#123456")
            });
            var httpResponse = TestingEngine.HttpClient.PostAsync("/api/user/register", postContent).Result;

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            var userSession = httpResponse.Content.ReadAsAsync <UserSessionModel>().Result;

            // Assert
            Assert.AreEqual(userSession.UserName, username);
            Assert.IsNotNull(userSession.Access_Token);
        }
Esempio n. 20
0
        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);
        }