You can use the i-net PDFC Server to compare PDF files in your NUnit tests on any computer in your network. This can be done by your continuous integration server or from within the IDE of the developers.
Before you can start with NUnit testing you need:
In your test enviroment you need to add the required dependencies:
For running the PDFC NUnit Tests in Visual Studio, additional NuGet packages are required:
using NUnit.Framework; using PDFCNUnit.Inet.Pdfc; using System.Diagnostics; namespace PDFCNUnitTest { [TestFixture] public class PdfcAssertTest { [OneTimeSetUp] public void Init() { // the URL to the i-net PDFC server PdfcAssert.SetServicePath("http://localhost:9900"); // if the current windows user has no access to the server PdfcAssert.SetCredentials("user", "password"); // specify the PDFC settings to be used PdfcAssert.SetPdfcConfiguration("Text only"); // the default log level is SourceLevels.Warning // if you search for problems then you can enable the logging //PdfcAssert.SetLogLevel(SourceLevels.Verbose); } [Test] public void MyTest() { // compare if both files are equals PdfcAssert.AssertPdfEquals( "file1.pdf", "file2.pdf" ); } } }