Example #1
0
        public void GetModuleShouldThrowWhenNotKnownPlatformIdPassed()
        {
            // Arrange
            var wkHtmlToXConfiguration = new WkHtmlToXConfiguration(12345, null);

            // ReSharper disable once AssignmentIsFullyDiscarded
#pragma warning disable IDISP004 // Don't ignore created IDisposable.
            Action action = () => _ = _sut.Create(wkHtmlToXConfiguration);
#pragma warning restore IDISP004 // Don't ignore created IDisposable.

            // Act & Assert
            action.Should().Throw <InvalidPlatformIdentifierException>();
        }
Example #2
0
 [TestCase(PlatformID.WinCE)]        // No plans for support.
 public void Platform_Unsupported(PlatformID platform)
 {
     // Arrange
     // Act
     // Assert
     Assert.Catch <PlatformNotSupportedException>(() => LibraryLoaderFactory.Create(platform));
 }
Example #3
0
        private static IEnumerable <ILibraryLoader> GetLibraryLoaders()
        {
            yield return(LibraryLoaderFactory.Create());

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                yield return(new UnixDl2LibraryLoader());
            }
        }
Example #4
0
        public void UnixPlatform_ThrowsPlatformNotSupportedException()
        {
            // Arrange

            // Act
            var result = LibraryLoaderFactory.Create(PlatformID.MacOSX);

            // Assert
            Assert.IsInstanceOf <UnixLibraryLoader>(result);
        }
Example #5
0
        public void WindowsPlatform_ReturnsWindowsImplementation()
        {
            // Arrange

            // Act
            var result = LibraryLoaderFactory.Create(PlatformID.Win32NT);

            // Assert
            Assert.IsInstanceOf <WindowsLibraryLoader>(result);
        }