コード例 #1
0
        public void Get_Blogs_Test()
        {
            //Arrange
            var controller = new BlogController();

            // Act
            var result = controller.Get();

            // Assert
            // TODO consider using MOQ instead?
            Assert.AreEqual(result.StatusCode, HttpStatusCode.OK);
        }
コード例 #2
0
        public void Blog_Must_Validate_And_Return_Message()
        {
            // Arrange
            var controller = new BlogController();
            var blog = new BlogDto();

            // Act
            var result = controller.Put(blog);

            // Assert
            Assert.AreEqual(result.StatusCode, HttpStatusCode.BadRequest);
        }
コード例 #3
0
        public void Put_Valid_Blog_Test()
        {
            // Arrange
            var controller = new BlogController();
            var blog = new BlogDto();
            blog.AuthorName = "somename";
            blog.Title = "SomeTitle";

            // Act
            var result = controller.Put(blog);

            // Assert
            Assert.AreEqual(result.StatusCode, HttpStatusCode.OK);
        }