Exemplo n.º 1
0
        public void PostATweet_WhenPosted_ShouldReturnOKstatusCode()
        {
            //Arrange

            var mySqlDatabase   = new SqlDatabase();
            var tweetController = new TweetController(mySqlDatabase);
            var blogPost        = GetValidPost();


            //Act
            var result = tweetController.Post(blogPost);

            //Assert
            Assert.IsType <OkObjectResult>(result);
        }
Exemplo n.º 2
0
        public void PostATweet_WhenPosted_ShouldReturnSameString()
        {
            //Arrange

            var mySqlDatabase   = new SqlDatabase();
            var tweetController = new TweetController(mySqlDatabase);
            var blogPost        = GetValidPost();
            var expectedResult  = blogPost.Content;

            //Act
            var result = tweetController.Post(blogPost);
            var model  = result as OkObjectResult;

            //Assert
            Assert.Equal(expectedResult, model.Value);
        }