/// <summary> /// Add a Notification to the List. /// </summary> public void AddNotification(string p_ServerTime, string p_Notify_id, string p_Time, string p_Type, string p_Subject) { if (Notifications.All(notification => notification.Notify_ID != p_Notify_id)) { Notifications.Add(new Notification(p_ServerTime, p_Notify_id, p_Time, p_Type, p_Subject)); } else { return; } }
public void AddNotification(Notification connectToLastFmNotification) { if (Notifications == null) { Notifications = new Collection <Notification>(); } if (Notifications.All(c => c.Type == connectToLastFmNotification.Type && !c.Read)) { Notifications.Add(connectToLastFmNotification); DomainEvents.Raise(new NotificationAdded() { Artist = this, LastNotification = connectToLastFmNotification }); } }
public void should_not_have_any_default_notifications() { var notifications = Notifications.All(); notifications.Should().BeEmpty(); }