mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-20 20:07:57 +08:00
#24 start adding classes for the acroform api
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using Xunit;
|
||||
|
||||
public class AcroFormsBasicFieldsTests
|
||||
{
|
||||
private static string GetFilename()
|
||||
{
|
||||
return IntegrationHelpers.GetDocumentPath("AcroFormsBasicFields");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetFormNotNull()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename(), new ParsingOptions { UseLenientParsing = false }))
|
||||
{
|
||||
var form = document.GetForm();
|
||||
Assert.NotNull(form);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetFormDisposedThrows()
|
||||
{
|
||||
var document = PdfDocument.Open(GetFilename());
|
||||
|
||||
document.Dispose();
|
||||
|
||||
Action action = () => document.GetForm();
|
||||
|
||||
Assert.Throws<ObjectDisposedException>(action);
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Reference in New Issue
Block a user