public void SaveIncidentApplicationInDb(IncidentApplication incidentApplication) { TestDatabaseInitializer.SeedDataForTest(dbContext => { dbContext.IncidentApplication.Add(incidentApplication); } ); }
public void SaveDraftApplicationInDb(DraftApplication draftApplication) { TestDatabaseInitializer.SeedDataForTest(dbContext => { dbContext.DraftApplication.Add(draftApplication); } ); }
public static (EmployeeId, EmployeeId) PrepareApplicantAndRandomEmployeeInDb() { var suspiciousEmployee = RandomEmployeeFactory.Create(); var applicant = CurrentLoggedEmployeeFactory.Create(); TestDatabaseInitializer.SeedDataForTest(dbContext => { dbContext.Employee.Add(applicant); dbContext.Employee.Add(suspiciousEmployee); }); return(applicant.Id, suspiciousEmployee.Id); }
public DraftApplication CreateDraftApplicationInDb(EmployeeId applicant, EmployeeId suspiciousEmployee, bool withAttachments = false) { var draftApplication = this.CreateTestDraftApplicationEntity(applicant, suspiciousEmployee); if (withAttachments) { this.AddAttachment(draftApplication); } TestDatabaseInitializer.SeedDataForTest(dbContext => { dbContext.DraftApplication.Add(draftApplication); }); return(draftApplication); }
public static List <EmployeeId> CreateRandomEmployeeInDb(int count) { var employees = new List <Employee>(); for (var i = 0; i < count; i++) { employees.Add(RandomEmployeeFactory.Create()); } TestDatabaseInitializer.SeedDataForTest(dbContext => { dbContext.Employee.AddRange(employees); }); return(employees.Select(x => x.Id).ToList()); }