Пример #1
0
 public IncidentApplication Build()
 {
     this._suspiciousEmployees = this.TryBuildSuspiciousEmployees();
     this._attachments         = this.TryBuildAttachments();
     return(IncidentApplication.Create(this._title, this._content, this._incidentType, this._applicantId,
                                       this._suspiciousEmployees, this._attachments));
 }
Пример #2
0
 public void SaveIncidentApplicationInDb(IncidentApplication incidentApplication)
 {
     TestDatabaseInitializer.SeedDataForTest(dbContext =>
     {
         dbContext.IncidentApplication.Add(incidentApplication);
     }
                                             );
 }
Пример #3
0
        public async Task Create(IncidentApplication incidentApplication, CancellationToken cancellationToken)
        {
            if (incidentApplication == null)
            {
                throw new ArgumentNullException(nameof(incidentApplication));
            }

            await this._writeContext.IncidentApplication.AddAsync(incidentApplication, cancellationToken);
        }
Пример #4
0
 public IncidentApplication CreateApplication(PostApplicationInput request, List <Attachment> attachments)
 {
     return(IncidentApplication.Create(
                new Title(request.Title),
                new Content(request.Content),
                new IncidentType(request.IncidentType),
                new EmployeeId(this._applicantContext.UserId),
                new List <EmployeeId>(
                    request.SuspiciousEmployees.Select(x => new EmployeeId(x))),
                attachments));
 }
Пример #5
0
        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);
        }
Пример #6
0
        private void BuildOutput(IncidentApplication incidentApplication)
        {
            var postApplicationOutput = new PostApplicationOutput(incidentApplication.Id.Value);

            this._outputPort.Standard(postApplicationOutput);
        }
Пример #7
0
 public IncidentApplicationCreated(IncidentApplication application) : base(application.Id.Value.ToString())
 {
     this.IncidentApplication = application;
 }