public void FromQueueMessage_Valid_TestMethod() { string testMessage = "E|Projection Requested|AAAA-BBBB-CDEF012345|2|null||Bank|Account|A-123456-BB|Balance|null|"; var testObj = ProjectionRequested.FromQueuedMessage(testMessage); Assert.IsNotNull(testObj); }
public void FromQueueMessage_Blank_TestMethod() { string testMessage = ""; var testObj = ProjectionRequested.FromQueuedMessage(testMessage); Assert.IsNull(testObj); }
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); }
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); }