Ejemplo n.º 1
0
        public void MakeQueueName_Inalid_TestMethod()
        {
            string expected = "bank-account";
            string actual   = "not set";

            IEventStreamIdentity target = new EventStreamAttribute("1Bank", "Account-", "J920377-A");

            actual = QueueNotificationDispatcher.MakeQueueName(target);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void FromQueueMessage_Valid_AsOfDate_TestMethod()
        {
            DateTime expected = new DateTime(2020, 12, 19);
            DateTime actual   = new DateTime(1984, 3, 15);

            IEventStreamIdentity cmdTest = new Common.Binding.EventStreamAttribute("Bank", "Apply Interest", "A-123456-BB");

            string testMessage = QueueNotificationDispatcher.MakeMessageString(cmdTest,
                                                                               QueueNotificationDispatcher.NOTIFICATION_NEW_EVENT,
                                                                               "Projection Requested",
                                                                               3);

            testMessage += $"|Bank|Account|A-123456-BB|Balance|2020-12-19|123456789-ab";

            var testObj = ProjectionRequested.FromQueuedMessage(testMessage);

            actual = testObj.AsOfDate.GetValueOrDefault();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void FromQueueMessage_Valid_Correlation_TestMethod()
        {
            string expected = "123456789-ab";
            string actual   = "not set";

            IEventStreamIdentity cmdTest = new Common.Binding.EventStreamAttribute("Bank", "Apply Interest", "A-123456-BB");

            string testMessage = QueueNotificationDispatcher.MakeMessageString(cmdTest,
                                                                               QueueNotificationDispatcher.NOTIFICATION_NEW_EVENT,
                                                                               "Projection Requested",
                                                                               3);

            testMessage += $"|Bank|Account|A-123456-BB|Balance|null|123456789-ab";

            var testObj = ProjectionRequested.FromQueuedMessage(testMessage);

            actual = testObj.CorrelationIdentifier;

            Assert.AreEqual(expected, actual);
        }