public void DirectorCreateisCreated() { _directorController = new DirectorsController(_directorRepository); var type = typeof(ViewResult); var real = _directorController.Create(); Assert.IsInstanceOfType(real, type); }
public void DirectorCreateisCreatedOnFake() { _directorController = new DirectorsController(_fakeDirectorRepository); var type = typeof(ActionResult); var real = _directorController.Create(new Director()); Assert.IsInstanceOfType(real, type); }
public void Create_SameDirectorName_DoesntAdd() { var firstDirector = new DirectorCreationBindingModel() { FullName = "first" }; var secondDirector = new DirectorCreationBindingModel() { FullName = "first" }; var controller = new DirectorsController(dbContext, mapper); controller.Create(firstDirector); controller.Create(secondDirector); var directors = dbContext.Directors.ToList(); Assert.AreEqual(1, directors.Count); }