ScaleTestMatzen: Add more tests

This commit is contained in:
lorenz.stechauner committed 2024-02-18 20:47:12 +01:00
1 parent f4eb6456be
commit 7f4cfdc1b5
2 files changed
+67 -11

No files matched your search

+3 -1
View File
@@ -44,6 +44,8 @@ namespace Elwig.Helpers.Weighing {
} else {
throw new ArgumentException("Unsupported scheme");
}
Stream.WriteTimeout = 250;
Stream.ReadTimeout = 11000;
if (empty != null) {
var parts = empty.Split(':');
@@ -105,7 +107,7 @@ namespace Elwig.Helpers.Weighing {
line = await reader.ReadLineAsync();
if (LogPath != null) await File.AppendAllTextAsync(LogPath, $"{line}\r\n");
}
if (line == null || line.Length < 4 || !line.StartsWith("<") || !line.EndsWith(">")) {
if (line == null || line.Length < 4 || !line.StartsWith('<') || !line.EndsWith('>')) {
throw new IOException("Invalid response from scale");
}