コード例 #1
0
        public void Create_Should_Return_Create_View()
        {
            //Arrange
            var mockSet = new Mock<DbSet<Event>>();
            var mockContext = new Mock<SchedulerDbContext>();
            mockContext.Setup(c => c.Events).Returns(mockSet.Object);

            var controller = new EventsController();

            //Act
            var result = controller.Create() as ViewResult;

            //Assert
            Assert.IsNotNull(result);
        }