public AuditTeamDataMock(Guid projectId, Guid auditorId) { AuditTeam = new AuditTeam() { ProjectId = projectId, AuditorId = auditorId }; }
public ActionResult Add(Guid?guid) //TODO nie można aplikować na swój projekt { if (guid == null || guid == Guid.Empty) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var auditTeam = new AuditTeam() { ProjectId = (Guid)guid, AuditorId = Guid.Parse(User.Identity.GetUserId()) }; _auditTeamRepository.Add(auditTeam); TempData["Message"] = "Your application was saved!"; return(RedirectToAction("Index", "Home")); }
public ProjectDataMock(AuditorDataMock auditorDataMock) { // ReSharper disable once UseObjectOrCollectionInitializer Project = new Project() { ProjectName = ProjectName, ProjectStartDate = ProjectStartDate, ProjectEndDate = ProjectEndDate, }; // ReSharper disable once ArrangeThisQualifier Project.Client = new ClientDataMock(this.Project).Client; //must be outside of Project initializer or this will be null var auditTeamMember = new AuditTeam() { Auditor = auditorDataMock.Auditor }; Project.Auditors.Add(auditTeamMember); Project.Auditors.Add(auditTeamMember); }