public void PDFiumLibraryNotLoadedException_CreateException_Call_NoException() { var library = "l-i-b-r-a-r-y"; var number = 5; var numberString = " 5 "; var e = PDFiumLibraryNotLoadedException.CreateException(library, number); #if NET48 Assert.IsTrue(e.Message.Contains(library)); Assert.IsTrue(e.Message.Contains(numberString)); #else Assert.IsTrue(e.Message.Contains(library, StringComparison.InvariantCulture)); Assert.IsTrue(e.Message.Contains(numberString, StringComparison.InvariantCulture)); #endif }
private static void LoadDll() { // Determine and load pdfium library _libraryName = Environment.Is64BitProcess ? "PDFium\\x64\\pdfium.dll" : "PDFium\\x86\\pdfium.dll"; _libraryHandle = NativeMethods.LoadLibrary(_libraryName); if (_libraryHandle == IntPtr.Zero) { throw PDFiumLibraryNotLoadedException.CreateException(_libraryName, Marshal.GetLastWin32Error()); } // Load the functions declared in view header - fpdfview.h. LoadDllViewPart(); // Load the functions declared in doc header - fpdf_doc.h. LoadDllDocPart(); // Load the functions declared in text header - fpdf_text.h. LoadDllTextPart(); // Load the functions declared in annot header - fpdf_annot.h. LoadDllAnnotPart(); }