Beispiel #1
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);
        }
Beispiel #2
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);
        }