コード例 #1
0
        public MultipartFormDataContent CreateRequestContent(Guid suspiciousEmployee, Guid?draftApplicationId)
        {
            var title               = FakeData.AlphaNumeric(10);
            var description         = FakeData.AlphaNumeric(99);
            var incidentType        = IncidentType.AdverseEffectForTheCompany;
            var suspiciousEmployees = new List <Guid> {
                suspiciousEmployee
            };

            var formData = new MultipartFormDataContent
            {
                { new StringContent(title), nameof(PostApplicationRequest.Title) },
                { new StringContent(description), nameof(PostApplicationRequest.Content) },
                { new StringContent(incidentType.ToString()), nameof(PostApplicationRequest.IncidentType) },
                {
                    new StringContent(string.Join(", ", suspiciousEmployees)),
                    nameof(PostApplicationRequest.SuspiciousEmployees)
                }
            };

            this.AddAttachments(formData, new List <string>()
            {
                "Text.txt"
            });
            if (draftApplicationId.HasValue)
            {
                this.AddDraftApplicationId(formData, draftApplicationId.Value);
            }

            return(formData);
        }
コード例 #2
0
        private UpdateDraftApplicationInput CreateUseCaseWithRequiredFields(Guid draftApplicationId,
                                                                            List <Guid> suspiciousEmployees, string incidentType, List <FileData> addedAttachments,
                                                                            List <Guid> deleteAttachments)
        {
            var title       = FakeData.AlphaNumeric(10);
            var description = FakeData.AlphaNumeric(99);

            return(new UpdateDraftApplicationInput(
                       draftApplicationId,
                       title,
                       description,
                       incidentType,
                       suspiciousEmployees,
                       addedAttachments,
                       deleteAttachments));
        }
コード例 #3
0
        public CreateDraftApplicationInput CreateUseCaseWithRequiredFields(Guid suspiciousEmployee, List <string> fileNames = null)
        {
            var title               = FakeData.AlphaNumeric(10);
            var description         = FakeData.AlphaNumeric(99);
            var incidentType        = IncidentType.AdverseEffectForTheCompany.Value;
            var suspiciousEmployees = new List <Guid> {
                suspiciousEmployee
            };
            var attachments = fileNames
                              ?.Select(FileDataFactory.Create).ToList();

            return(new CreateDraftApplicationInput(
                       title,
                       description,
                       incidentType,
                       suspiciousEmployees,
                       attachments));
        }
コード例 #4
0
        public MultipartFormDataContent CreateRequestContent(Guid suspiciousEmployee)
        {
            var title               = FakeData.AlphaNumeric(10);
            var description         = FakeData.AlphaNumeric(99);
            var incidentType        = IncidentType.AdverseEffectForTheCompany;
            var suspiciousEmployees = new List <Guid> {
                suspiciousEmployee
            };

            var formData = new MultipartFormDataContent
            {
                { new StringContent(title), nameof(CreateDraftApplicationRequest.Title) },
                { new StringContent(description), nameof(CreateDraftApplicationRequest.Content) },
                { new StringContent(incidentType.ToString()), nameof(CreateDraftApplicationRequest.IncidentType) },
                {
                    new StringContent(string.Join(", ", suspiciousEmployees)),
                    nameof(CreateDraftApplicationRequest.SuspiciousEmployees)
                }
            };

            return(formData);
        }
コード例 #5
0
        public PostApplicationInput CreateInput(Guid suspiciousEmployee, Guid?draftApplicationId)
        {
            var fileNames = new List <string> {
                "test.txt, test1.txt"
            };
            var title               = FakeData.AlphaNumeric(10);
            var description         = FakeData.AlphaNumeric(99);
            var incidentType        = IncidentType.AdverseEffectForTheCompany.Value;
            var suspiciousEmployees = new List <Guid> {
                suspiciousEmployee
            };
            var attachments = fileNames
                              .Select(FileDataFactory.Create).ToList();

            return(new PostApplicationInput(
                       draftApplicationId,
                       title,
                       description,
                       incidentType,
                       suspiciousEmployees,
                       attachments));
        }