public void WhenValidFormInformation_ShouldReturnBytesOfModifedPdf() { // arrange var pdfUtils = new PdfTestUtils(); var fileName = "BootCampForm-v2.pdf"; pdfUtils.UploadTemplateToCloud(fileName); var pdfManipuation = new PdfManipuation(); var fields = new List <SimplePdfFormField> { new SimplePdfFormField { Name = "FirstName", Value = "Travis" }, new SimplePdfFormField { Name = "Surname", Value = "Frisinger" }, new SimplePdfFormField { Name = "DateOfBirth", Value = "1981-04-29" }, }; var cloudStorageName = pdfManipuation.PopulateTemplate(fileName, fields); // act var actual = pdfManipuation.MarkFieldsAsReadOnly(cloudStorageName, fields); // assert var expectedLength = pdfUtils.FetchExpectedFileLength("readonly.pdf"); actual.Length.Should().Be(expectedLength); }
public void WhenValidFormInformation_ShouldReturnNewFileNameOfPopulatedPdf() { // arrange var pdfUtils = new PdfTestUtils(); var fileName = "BootCampForm-v2.pdf"; pdfUtils.UploadTemplateToCloud(fileName); var pdfManipuation = new PdfManipuation(); var fields = new List <SimplePdfFormField> { new SimplePdfFormField { Name = "FirstName", Value = "Bob" }, new SimplePdfFormField { Name = "Surname", Value = "Smith" }, new SimplePdfFormField { Name = "DateOfBirth", Value = "1981-04-29" } }; // act var actual = pdfManipuation.PopulateTemplate(fileName, fields); // assert var expected = $"-{fileName}"; actual.Should().Contain(expected); }