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>(); }
[TestCase(PlatformID.WinCE)] // No plans for support. public void Platform_Unsupported(PlatformID platform) { // Arrange // Act // Assert Assert.Catch <PlatformNotSupportedException>(() => LibraryLoaderFactory.Create(platform)); }
private static IEnumerable <ILibraryLoader> GetLibraryLoaders() { yield return(LibraryLoaderFactory.Create()); if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { yield return(new UnixDl2LibraryLoader()); } }
public void UnixPlatform_ThrowsPlatformNotSupportedException() { // Arrange // Act var result = LibraryLoaderFactory.Create(PlatformID.MacOSX); // Assert Assert.IsInstanceOf <UnixLibraryLoader>(result); }
public void WindowsPlatform_ReturnsWindowsImplementation() { // Arrange // Act var result = LibraryLoaderFactory.Create(PlatformID.Win32NT); // Assert Assert.IsInstanceOf <WindowsLibraryLoader>(result); }