Exemple #1
0
        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);
        }
Exemple #2
0
        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();
            });
        }