-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSendTimeoutTests.cs
More file actions
99 lines (89 loc) · 3.95 KB
/
SendTimeoutTests.cs
File metadata and controls
99 lines (89 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using BuslyCLI.Console.Tests.TestHelpers;
namespace BuslyCLI.Console.Tests.Commands.NsbTimeout;
public class SendTimeoutTests : CommandTestBase
{
[Test]
public void ShouldOutputAnErrorWhenTransportIsSqlServer()
{
// Arrange
var yamlFile = """
---
current-transport: local-sql-server
transports:
- name: local-sql-server
sql-server-transport-config:
connection-string: Server=localhost;Database=test;
""";
using var configFile = new TestableNServiceBusConfigurationFile(yamlFile);
// Act
var result = Sut.Run(
"timeout", "send",
"--content-type", "application/json",
"--enclosed-message-type", "MessageContracts.Timeouts.OrderTimeout",
"--destination-endpoint", "Sales",
"--message-body", "{}",
"--delay-delivery-with", "00:00:01",
"--config", configFile.FilePath);
// Assert
Assert.That(result.ExitCode, Is.EqualTo(1));
Assert.That(result.Output, Does.Contain("SqlServerTransport"));
Assert.That(result.Output, Does.Contain("does not support sending timeouts"));
Assert.That(result.Output, Does.Contain("https://tragiccode.com/busly-cli/docs/cli-reference/timeout/send"));
}
[Test]
public void ShouldOutputAnErrorWhenTransportIsPostgreSql()
{
// Arrange
var yamlFile = """
---
current-transport: local-postgresql
transports:
- name: local-postgresql
postgre-sql-transport-config:
connection-string: Host=localhost;Database=test;
""";
using var configFile = new TestableNServiceBusConfigurationFile(yamlFile);
// Act
var result = Sut.Run(
"timeout", "send",
"--content-type", "application/json",
"--enclosed-message-type", "MessageContracts.Timeouts.OrderTimeout",
"--destination-endpoint", "Sales",
"--message-body", "{}",
"--delay-delivery-with", "00:00:01",
"--config", configFile.FilePath);
// Assert
Assert.That(result.ExitCode, Is.EqualTo(1));
Assert.That(result.Output, Does.Contain("PostgreSqlTransport"));
Assert.That(result.Output, Does.Contain("does not support sending timeouts"));
Assert.That(result.Output, Does.Contain("https://tragiccode.com/busly-cli/docs/cli-reference/timeout/send"));
}
[Test]
public void ShouldOutputAnErrorWhenTransportIsAzureStorageQueues()
{
// Arrange
var yamlFile = """
---
current-transport: local-azure-storage-queues
transports:
- name: local-azure-storage-queues
azure-storage-queues-transport-config:
connection-string: UseDevelopmentStorage=true
""";
using var configFile = new TestableNServiceBusConfigurationFile(yamlFile);
// Act
var result = Sut.Run(
"timeout", "send",
"--content-type", "application/json",
"--enclosed-message-type", "MessageContracts.Timeouts.OrderTimeout",
"--destination-endpoint", "Sales",
"--message-body", "{}",
"--delay-delivery-with", "00:00:01",
"--config", configFile.FilePath);
// Assert
Assert.That(result.ExitCode, Is.EqualTo(1));
Assert.That(result.Output, Does.Contain("AzureStorageQueuesTransport"));
Assert.That(result.Output, Does.Contain("does not support sending timeouts"));
Assert.That(result.Output, Does.Contain("https://tragiccode.com/busly-cli/docs/cli-reference/timeout/send"));
}
}