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

            // Assert
            Assert.Null(owner);
        }
示例#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");
        }
示例#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());
        }
示例#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());
        }
示例#5
0
 private static Guid?GetOwner(string message)
 {
     return(QueueCausalityManager.GetOwner(CreateMessage(message)));
 }
示例#6
0
 public void Setup()
 {
     queueCausalityManager = new QueueCausalityManager(new NullLoggerFactory());
 }