public async Task <IActionResult> Create([Bind("DirectorId,Name")] Director director) { if (ModelState.IsValid) { await _directorService.AddAndSave(director); return(RedirectToAction(nameof(Index))); } return(View(director)); }
public async Task AddTest() { var fakeRepository = Mock.Of <IDirectorRepository>(); var directorService = new DirectorService(fakeRepository); var director = new Director() { Name = "Test Director" }; await directorService.AddAndSave(director); }