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); }
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))); }