Beispiel #1
0
        private static void TestOwnerIsNull(QueueMessage message)
        {
            // Act
            Guid?owner = QueueCausalityManager.GetOwner(message);

            // Assert
            Assert.Null(owner);
        }
Beispiel #2
0
        public void SetOwner_IfUnsupportedValueType_Throws()
        {
            // Arrange
            var  jobject = CreateJsonObject(123);
            Guid g       = Guid.NewGuid();

            // Act & Assert
            ExceptionAssert.ThrowsArgumentNull(() => QueueCausalityManager.SetOwner(g, jobject), "token");
        }
Beispiel #3
0
        public void SetOwner_IfValidOwner_AddsOwner()
        {
            // Arrange
            var jobject = CreateJsonObject(new Payload {
                Val = 123
            });
            Guid g = Guid.NewGuid();

            // Act
            QueueCausalityManager.SetOwner(g, jobject);

            // Assert
            AssertOwnerEqual(g, jobject.ToString());
        }
Beispiel #4
0
        public void SetOwner_IfEmptyOwner_DoesNotAddOwner()
        {
            // Arrange
            var jobject = CreateJsonObject(new Payload {
                Val = 123
            });
            Guid g = Guid.Empty;

            // Act
            QueueCausalityManager.SetOwner(g, jobject);

            // Assert
            AssertOwnerIsNull(jobject.ToString());
        }
Beispiel #5
0
 private static Guid?GetOwner(string message)
 {
     return(QueueCausalityManager.GetOwner(CreateMessage(message)));
 }
Beispiel #6
0
 public void Setup()
 {
     queueCausalityManager = new QueueCausalityManager(new NullLoggerFactory());
 }