-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
63 additions
and
17 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
samples/OpenTelemetry/Consumer/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"profiles": { | ||
"Consumer": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "https://localhost:52053;http://localhost:52054" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
samples/OpenTelemetry/Sweeper/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"profiles": { | ||
"Sweeper": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "https://localhost:52051;http://localhost:52052" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#region Licence | ||
#region Licence | ||
|
||
/* The MIT License (MIT) | ||
Copyright © 2014 Francesco Pighi <[email protected]> | ||
|
@@ -38,7 +38,7 @@ public class SqlOutboxWritingMessageTests : IDisposable | |
private readonly string _key3 = "name3"; | ||
private readonly string _key4 = "name4"; | ||
private readonly string _key5 = "name5"; | ||
private readonly Message _message; | ||
private Message _message; | ||
private readonly MsSqlOutbox _sqlOutbox; | ||
private Message _storedMessage; | ||
private readonly string _value1 = "value1"; | ||
|
@@ -47,14 +47,15 @@ public class SqlOutboxWritingMessageTests : IDisposable | |
private readonly Guid _value4 = Guid.NewGuid(); | ||
private readonly DateTime _value5 = DateTime.UtcNow; | ||
private readonly MsSqlTestHelper _msSqlTestHelper; | ||
private readonly MessageHeader _messageHeader; | ||
|
||
public SqlOutboxWritingMessageTests() | ||
{ | ||
_msSqlTestHelper = new MsSqlTestHelper(); | ||
_msSqlTestHelper.SetupMessageDb(); | ||
|
||
_sqlOutbox = new MsSqlOutbox(_msSqlTestHelper.OutboxConfiguration); | ||
var messageHeader = new MessageHeader( | ||
_messageHeader = new MessageHeader( | ||
messageId:Guid.NewGuid(), | ||
topic: "test_topic", | ||
messageType: MessageType.MT_DOCUMENT, | ||
|
@@ -64,23 +65,40 @@ public SqlOutboxWritingMessageTests() | |
correlationId: Guid.NewGuid(), | ||
replyTo: "ReplyAddress", | ||
contentType: "text/plain"); | ||
messageHeader.Bag.Add(_key1, _value1); | ||
messageHeader.Bag.Add(_key2, _value2); | ||
messageHeader.Bag.Add(_key3, _value3); | ||
messageHeader.Bag.Add(_key4, _value4); | ||
messageHeader.Bag.Add(_key5, _value5); | ||
_messageHeader.Bag.Add(_key1, _value1); | ||
_messageHeader.Bag.Add(_key2, _value2); | ||
_messageHeader.Bag.Add(_key3, _value3); | ||
_messageHeader.Bag.Add(_key4, _value4); | ||
_messageHeader.Bag.Add(_key5, _value5); | ||
} | ||
|
||
_message = new Message(messageHeader, new MessageBody("message body")); | ||
[Fact] | ||
public void When_Writing_A_Message_To_The_MSSQL_Outbox() | ||
{ | ||
_message = new Message(_messageHeader, new MessageBody("message body")); | ||
_sqlOutbox.Add(_message); | ||
|
||
AssertMessage(); | ||
} | ||
|
||
[Fact] | ||
public void When_Writing_A_Message_To_The_MSSQL_Outbox() | ||
public void When_Writing_A_Message_With_a_Null_To_The_MSSQL_Outbox() | ||
{ | ||
_message = new Message(_messageHeader, null); | ||
_sqlOutbox.Add(_message); | ||
|
||
AssertMessage(); | ||
} | ||
|
||
private void AssertMessage() | ||
{ | ||
_storedMessage = _sqlOutbox.Get(_message.Id); | ||
|
||
//should read the message from the sql outbox | ||
_storedMessage.Body.Value.Should().Be(_message.Body.Value); | ||
if (!string.IsNullOrEmpty(_storedMessage.Body.Value)) | ||
_storedMessage.Body.Value.Should().Be(_message.Body.Value); | ||
else | ||
Assert.Null(_message.Body); | ||
//should read the header from the sql outbox | ||
_storedMessage.Header.Topic.Should().Be(_message.Header.Topic); | ||
_storedMessage.Header.MessageType.Should().Be(_message.Header.MessageType); | ||
|
@@ -90,8 +108,8 @@ public void When_Writing_A_Message_To_The_MSSQL_Outbox() | |
_storedMessage.Header.CorrelationId.Should().Be(_message.Header.CorrelationId); | ||
_storedMessage.Header.ReplyTo.Should().Be(_message.Header.ReplyTo); | ||
_storedMessage.Header.ContentType.Should().Be(_message.Header.ContentType); | ||
|
||
|
||
//Bag serialization | ||
_storedMessage.Header.Bag.ContainsKey(_key1).Should().BeTrue(); | ||
_storedMessage.Header.Bag[_key1].Should().Be(_value1); | ||
|
@@ -103,7 +121,7 @@ public void When_Writing_A_Message_To_The_MSSQL_Outbox() | |
_storedMessage.Header.Bag[_key4].Should().Be(_value4); | ||
_storedMessage.Header.Bag.ContainsKey(_key5).Should().BeTrue(); | ||
_storedMessage.Header.Bag[_key5].Should().Be(_value5); | ||
} | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
|