예제 #1
0
 public void SaveIncidentApplicationInDb(IncidentApplication incidentApplication)
 {
     TestDatabaseInitializer.SeedDataForTest(dbContext =>
     {
         dbContext.IncidentApplication.Add(incidentApplication);
     }
                                             );
 }
예제 #2
0
 public void SaveDraftApplicationInDb(DraftApplication draftApplication)
 {
     TestDatabaseInitializer.SeedDataForTest(dbContext =>
     {
         dbContext.DraftApplication.Add(draftApplication);
     }
                                             );
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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());
        }