Fix tests on non-windows

This commit is contained in:
Ben Olden-Cooligan 2024-01-11 19:26:07 -08:00
parent 6b17c5ecc9
commit f4f782a4e9
3 changed files with 8 additions and 8 deletions

View File

@ -30,7 +30,7 @@ public class ClientServerTests
{
IpV4 = IPAddress.Loopback,
IpV6 = IPAddress.IPv6Loopback,
Host = IPAddress.IPv6Loopback.ToString(),
Host = $"[{IPAddress.IPv6Loopback}]",
RemoteEndpoint = IPAddress.IPv6Loopback,
Port = deviceConfig.Port,
RootUrl = "eSCL",

View File

@ -1074,7 +1074,7 @@ public class CommandLineIntegrationTests : ContextualTests
BitDepth = ConsoleBitDepth.Gray,
Dpi = 300,
PageSize = "a4",
Driver = "twain",
Driver = "escl",
Device = "name1",
OutputPath = $"{FolderPath}/test.jpg",
Verbose = true
@ -1087,7 +1087,7 @@ public class CommandLineIntegrationTests : ContextualTests
options.BitDepth == BitDepth.Grayscale &&
options.Dpi == 300 &&
options.PageSize == PageSize.A4 &&
options.Driver == Driver.Twain &&
options.Driver == Driver.Escl &&
options.Device.Name == "test_name1"),
Arg.Any<CancellationToken>(),
Arg.Any<IScanEvents>(),
@ -1100,7 +1100,7 @@ public class CommandLineIntegrationTests : ContextualTests
{
var (_, scanDriverFactoryMock) = CreateDriverMocks();
var outputWriter = new StringWriter();
var outputWriter = new StringWriter { NewLine = "\n" };
await _automationHelper.WithContainerBuilder(container =>
{
container.RegisterInstance(new ConsoleOutput(outputWriter));
@ -1110,7 +1110,7 @@ public class CommandLineIntegrationTests : ContextualTests
ListDevices = true
}, scanDriverFactoryMock);
Assert.Equal("test_name1\r\ntest_name2\r\n", outputWriter.ToString());
Assert.Equal("test_name1\ntest_name2\n", outputWriter.ToString());
AssertRecoveryCleanedUp();
}

View File

@ -45,7 +45,7 @@ public class ScanErrorHandling : ContextualTests
bridgeFactory.When(factory => factory.Create(Arg.Any<ScanOptions>()))
.Do(_ => throw new InvalidOperationException());
var source = controller.Scan(new ScanOptions { Device = new ScanDevice(Driver.Wia, "foo", "bar") });
var source = controller.Scan(new ScanOptions { Device = new ScanDevice(Driver.Default, "foo", "bar") });
await Assert.ThrowsAsync<InvalidOperationException>(async () => await source.ToListAsync());
}
@ -91,7 +91,7 @@ public class ScanErrorHandling : ContextualTests
localPostProcessor.When(pp =>
pp.PostProcess(Arg.Any<ProcessedImage>(), Arg.Any<ScanOptions>(), Arg.Any<PostProcessingContext>()))
.Do(_ => throw new InvalidOperationException());
var source = controller.Scan(new ScanOptions { Device = new ScanDevice(Driver.Wia, "foo", "bar") });
var source = controller.Scan(new ScanOptions { Device = new ScanDevice(Driver.Default, "foo", "bar") });
await Assert.ThrowsAsync<InvalidOperationException>(async () => await source.ToListAsync());
}
@ -106,7 +106,7 @@ public class ScanErrorHandling : ContextualTests
bridgeFactory);
bridgeFactory.Create(Arg.Any<ScanOptions>()).Returns(bridge);
var source = controller.Scan(new ScanOptions { Device = new ScanDevice(Driver.Wia, "foo", "bar") });
var source = controller.Scan(new ScanOptions { Device = new ScanDevice(Driver.Default, "foo", "bar") });
await Assert.ThrowsAsync<InvalidOperationException>(async () => await source.ToListAsync());
}