public void WhenEmptyPassword_ShouldReturnZeroBytes(string password) { // arrange var fileName = "BootCampForm-v2.pdf"; var pdfUtils = new PdfTestUtils(); var pdfBytes = pdfUtils.FetchFileFromLocal(fileName); var pdfManipuation = new PdfManipuation(); // act var actual = pdfManipuation.PasswordProtect(pdfBytes, password); // assert actual.Length.Should().Be(0); }
public void WhenNonEmptyPassword_ShouldReturnBytesOfPasswordProtectedPdf() { // arrange var fileName = "BootCampForm-v2.pdf"; var password = "******"; var pdfUtils = new PdfTestUtils(); var pdfBytes = pdfUtils.FetchFileFromLocal(fileName); var pdfManipuation = new PdfManipuation(); // act var actual = pdfManipuation.PasswordProtect(pdfBytes, password); // assert Assert.DoesNotThrow(() => pdfUtils.DecryptBytes(actual, password)); }