public void CreateProject(CreateProjectRequest createProjectRequest) { var project = new Project { Id = Guid.NewGuid(), Name = createProjectRequest.Name, ProjectCode = createProjectRequest.ProjectCode }; repository.Insert(project); }
public ActionResult Create(CreateProjectRequest createProjectRequest) { if (!ModelState.IsValid) { return View(); } projectTasks.CreateProject(createProjectRequest); return RedirectToAction("Index"); }
public void Create_should_insert_project_into_repository() { var project = new CreateProjectRequest { Name = "Name", ProjectCode = "Code" }; CreateSUT().CreateProject(project); repository.AssertWasCalled(x => x.Insert(Arg<Project>.Matches(y => y.Id != Guid.Empty && y.Name == project.Name && y.ProjectCode == project.ProjectCode))); }