示例#1
0
        public void All_WithSomeFeedback_ShouldReturnView()
        {
            //Arrange
            var dbContext = new MockDbContext().GetContext();

            var feedback = new List <Feedback>()
            {
                new Feedback()
                {
                    Id = 1
                },
                new Feedback()
                {
                    Id = 2
                },
                new Feedback()
                {
                    Id = 3
                },
                new Feedback()
                {
                    Id = 4
                }
            };

            dbContext.Feedbacks.AddRange(feedback);
            dbContext.SaveChanges();

            //Act
            var controller = new FeedbackController(dbContext);
            var result     = controller.All();

            //Assert
            Assert.IsInstanceOfType(result as ViewResult, typeof(ViewResult));
        }