public static async Task UploadAttachmentAsync(
            UserType userType,
            string plant,
            int id,
            TestFile file,
            HttpStatusCode expectedStatusCode  = HttpStatusCode.OK,
            string expectedMessageOnBadRequest = null)
        {
            var httpContent = file.CreateHttpContent();
            var response    = await TestFactory.Instance.GetHttpClient(userType, plant).PostAsync($"{Route}/{id}/Attachments", httpContent);

            await TestsHelper.AssertResponseAsync(response, expectedStatusCode, expectedMessageOnBadRequest);
        }
Exemplo n.º 2
0
        public static async Task UploadFieldValueAttachmentAsync(
            UserType userType, string plant,
            int tagId,
            int requirementId,
            int fieldId,
            TestFile file,
            HttpStatusCode expectedStatusCode  = HttpStatusCode.OK,
            string expectedMessageOnBadRequest = null)
        {
            var httpContent = file.CreateHttpContent();
            var response    = await TestFactory.Instance.GetHttpClient(userType, plant).PostAsync($"{_route}/{tagId}/Requirements/{requirementId}/Attachment/{fieldId}", httpContent);

            await TestsHelper.AssertResponseAsync(response, expectedStatusCode, expectedMessageOnBadRequest);
        }