public void CanSelectNestedValue() { using var reader = new NotificationReader(Message); var actual = reader.StringEventValue("EventVersion"); Assert.That(actual, Is.EqualTo("1")); }
public override void FilterDispatch(string message) { using var reader = new NotificationReader(message); var notificationMessage = reader.StringEventValue(nameof(MyDomainEvent.Message)); MessageProducerFixture.NotificationMap.Add(Exchanges.AgilePm.ToString(), notificationMessage); }
public void CanDeserializeDateTime() { using var reader = new NotificationReader(Message); var actual = reader.OccurredOn(); Assert.That(actual, Is.EqualTo(DateTime.Parse("2020-03-28T19:04:53.191488+09:00"))); }
public void CanDeserializeString() { using var reader = new NotificationReader(Message); var actual = reader.NotificationId(); Assert.That(actual, Is.EqualTo(1)); }
/// <summary> /// This method fetches a 'List<Notification>' object. /// This method uses the 'Notifications_FetchAll' procedure. /// </summary> /// <returns>A 'List<Notification>'</returns> /// </summary> public List <Notification> FetchAllNotifications(FetchAllNotificationsStoredProcedure fetchAllNotificationsProc, DataConnector databaseConnector) { // Initial Value List <Notification> notificationCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allNotificationsDataSet = this.DataHelper.LoadDataSet(fetchAllNotificationsProc, databaseConnector); // Verify DataSet Exists if (allNotificationsDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allNotificationsDataSet); // if table exists if (table != null) { // Load Collection notificationCollection = NotificationReader.LoadCollection(table); } } } // return value return(notificationCollection); }
/// <summary> /// This method finds a 'Notification' object. /// This method uses the 'Notification_Find' procedure. /// </summary> /// <returns>A 'Notification' object.</returns> /// </summary> public Notification FindNotification(FindNotificationStoredProcedure findNotificationProc, DataConnector databaseConnector) { // Initial Value Notification notification = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet notificationDataSet = this.DataHelper.LoadDataSet(findNotificationProc, databaseConnector); // Verify DataSet Exists if (notificationDataSet != null) { // Get DataTable From DataSet DataRow row = this.DataHelper.ReturnFirstRow(notificationDataSet); // if row exists if (row != null) { // Load Notification notification = NotificationReader.Load(row); } } } // return value return(notification); }
public void CanRaiseExceptionWhenCanNotFindKeyword() { using var reader = new NotificationReader(Message); Assert.Catch <JsonException>(() => reader.StringEventValue("Dummy")); }