public void Create_ReturnsLeagueViewModelView()
        {
            //Arrange

            //Act
            var result = _leagueController.Create();

            //Assert
            Assert.NotNull(result);
            var viewResult = Assert.IsAssignableFrom <ViewResult>(result);
            var viewModel  = Assert.IsAssignableFrom <LeagueViewModel>(viewResult.ViewData.Model);
        }
예제 #2
0
        public async Task Test_Create_Creates_League()
        {
            var league = new League {
                Name = "National League"
            };

            await controller.Create(league);

            context.MockLeagues.Verify(x => x.Add(It.Is <League>(t => t == league)));
        }