コード例 #1
0
        public void ChangeBugStatus_Invalid_ShouldReturnBadRequest()
        {
            var server = new InMemoryHttpServer(this.inMemoryServerUrl, repo.Object);

            var response = server.CreatePutRequest("bugs?bugId=1&status=ForTesting");

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }
コード例 #2
0
        public void GetAllWithStatus_WhenBugsInDb_ShouldReturnStatus200()
        {
            var server = new InMemoryHttpServer(this.inMemoryServerUrl, repo.Object);

            var response = server.CreateGetRequest("bugs?status=Pending");

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.IsNotNull(response.Content);
        }
コード例 #3
0
        public void CreateBug_WhenBugsInDb_ShouldReturnStatus200()
        {
            Bug bug = new Bug()
            {
                LogText = "bug-buugg"
            };

            var server = new InMemoryHttpServer(this.inMemoryServerUrl, repo.Object);

            var response = server.CreatePostRequest(string.Format("bugs?bugLogText={0}", bug.LogText), bug);

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }
コード例 #4
0
        public void CreateBug_InvalidData_ShouldReturnBadRequest()
        {
            Bug bug = new Bug()
            {
                LogText = ""
            };

            var server = new InMemoryHttpServer(this.inMemoryServerUrl, repo.Object);

            var response = server.CreatePostRequest(string.Format("bugs?bugLogText={0}", bug.LogText), bug);

            Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode);
        }