public void TryCreate_HasMoreThan1000Chars_NotCreated() { AssertException <ArgumentException>(() => { new Content(FakeData.Alpha(1001)); }); }
public void AddDraftApplicationWithEmployeesInDatabase(ILifetimeScope scope) { var readContext = scope.Resolve <IncidentReportReadDbContext>(); readContext.Database.EnsureCreated(); readContext.DraftApplications.Add(new DraftApplication { Id = Guid.NewGuid(), IncidentType = "FinancialViolations", Title = FakeData.Alpha(10), Content = FakeData.Alpha(15), Applicant = this.CreateEmployee(), Attachments = new List <Attachment>() { CreateAttachment() }, DraftApplicationSuspiciousEmployees = new List <DraftApplicationSuspiciousEmployee>() { new DraftApplicationSuspiciousEmployee() { Employee = this.CreateEmployee() }, new DraftApplicationSuspiciousEmployee { Employee = this.CreateEmployee() } } }); readContext.SaveChanges(); }
public DraftApplication Create(EmployeeId applicant, List <EmployeeId> suspiciousEmployee) { var draftApplication = DraftApplication.Create( new Title(FakeData.Alpha(10)), new Content(FakeData.Alpha(100)), IncidentType.AdverseEffectForTheCompany, applicant, suspiciousEmployee); return(draftApplication); }
public IncidentApplication CreatePostedWithAttachments(EmployeeId applicant, EmployeeId suspiciousEmployee) { var incidentApplication = IncidentApplication.Create( new Title(FakeData.Alpha(12)), new Content(FakeData.Alpha(100)), IncidentType.AdverseEffectForTheCompany, applicant, new List <EmployeeId>() { suspiciousEmployee }, this.CreateAttachment()); return(incidentApplication); }
private DraftApplication CreateTestDraftApplicationEntity(EmployeeId applicantId, EmployeeId suspiciousEmployeeId) { var draftApplication = DraftApplication.Create( new Title(FakeData.Alpha(12)), new Content(FakeData.Alpha(100)), IncidentType.AdverseEffectForTheCompany, applicantId, new List <EmployeeId> { suspiciousEmployeeId }); return(draftApplication); }
public static IncidentApplication CreateInCreatedStateValid() { var applicationBuilder = new IncidentApplicationBuilder() .SetTitle(FakeData.Alpha(10)) .SetContent(FakeData.Alpha(100)) .SetIncidentType(IncidentType.AdverseEffectForTheCompany) .SetApplicantId(new EmployeeId(Guid.NewGuid())) .SetSuspiciousEmployees(x => x.SetEmployees(new List <EmployeeId> { new EmployeeId(Guid.NewGuid()) })); var createdApplication = applicationBuilder.Build(); return(createdApplication); }
public void IndicateAtLeastOneSuspect_NotCreated() { var employeeId = new EmployeeId(Guid.NewGuid()); var applicationBuilder = new IncidentApplicationBuilder() .SetApplicantId(employeeId) .SetSuspiciousEmployees(x => x.SetEmployees(new List <EmployeeId>())) .SetTitle(FakeData.Alpha(10)) .SetContent(FakeData.Alpha(100)) .SetIncidentType(IncidentType.AdverseEffectForTheCompany); AssertBrokenRule <IndicateAtLeastOneSuspectRule>(() => { var applicationDraft = applicationBuilder.Build(); }); }
public static Employee Create() { var userId = new TestCurrentUserContext().UserId; return(new Employee(userId, FakeData.Alpha(10), FakeData.Alpha(10))); }
public static Employee Create() { return(new Employee(Guid.NewGuid(), FakeData.Alpha(10), FakeData.Alpha(10))); }
public void TryCreate_Has10Chars_Created() { var content = new Content(FakeData.Alpha(10)); Assert.NotNull(content); }