Пример #1
0
        public void TriggerQueue_Equals_MisMatch_Expect_False()
        {
            var mockResource = new Mock <IResource>();

            mockResource.Setup(resource => resource.ResourceID).Returns(Guid.NewGuid());

            var mockOption = new Mock <IOption>();
            var mockInputs = new Mock <ICollection <IServiceInputBase> >();
            var resourceId = Guid.NewGuid();

            var triggerQueue = new TriggerQueue
            {
                QueueSourceId     = resourceId,
                QueueName         = "Queue",
                WorkflowName      = "Workflow",
                Concurrency       = 100,
                UserName          = "******",
                Password          = "******",
                Options           = new[] { mockOption.Object },
                QueueSinkId       = resourceId,
                DeadLetterQueue   = "DeadLetterQueue",
                DeadLetterOptions = new[] { mockOption.Object },
                MapEntireMessage  = true,
                Inputs            = mockInputs.Object,
                ResourceId        = resourceId
            };
            var otherTriggerQueue = new TriggerQueue {
                Concurrency = 2
            };
            var equals = triggerQueue.Equals(otherTriggerQueue);

            Assert.IsFalse(equals);
            Assert.AreEqual(resourceId, triggerQueue.ResourceId);
        }
Пример #2
0
        public void TriggerQueue_Equals_Other_IsNull_Expect_False()
        {
            var triggerQueue = new TriggerQueue();
            var equals       = triggerQueue.Equals(null);

            Assert.IsFalse(equals);
        }
Пример #3
0
        public void TriggerQueue_ReferenceEquals_Match_Expect_True()
        {
            var triggerQueue = new TriggerQueue {
                Concurrency = 1
            };
            var otherTriggerQueue = triggerQueue;
            var equals            = triggerQueue.Equals(otherTriggerQueue);

            Assert.IsTrue(equals);
        }