-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMessageEnvelopeTests.cs
More file actions
33 lines (26 loc) · 1.01 KB
/
MessageEnvelopeTests.cs
File metadata and controls
33 lines (26 loc) · 1.01 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
using CloudNimble.SimpleMessageBus.Core;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SimpleMessageBus.Tests.Shared;
namespace SimpleMessageBus.Tests.Core
{
[TestClass]
public class MessageEnvelopeTests
{
[TestMethod]
public void MessageEnvelope_SerializesMessageContent()
{
var testMessage = new TestMessage
{
Greeting = "Hello world!",
PickANumber = 42,
BirthDay = new System.DateTime(1970, 4, 14)
};
testMessage.Id.Should().NotBeEmpty();
var envelope = new MessageEnvelope(testMessage);
envelope.MessageContent.Should().NotBeNullOrEmpty();
envelope.MessageContent.Should().ContainAll(testMessage.Id.ToString(), testMessage.Greeting, testMessage.PickANumber.ToString(), testMessage.BirthDay.ToString("yyyy-MM-dd"));
envelope.MessageType.Should().Contain(testMessage.GetType().FullName);
}
}
}