public void Create_DataCorrect_NotificationCreated() { var user = UserFaker.Create(); var title = "test title"; var content = "content here"; var notification = UserNotificationRepository.Create(user, title, content, UserNotificationType.Warning); Assert.NotNull(notification); Assert.AreEqual(title, notification.title); Assert.AreEqual(content, notification.content); Assert.AreEqual(UserNotificationType.Warning, notification.type); }
public void Get_DataCorrect_GotNotifications() { var user = UserFaker.Create(); var title = "test title"; var content = "content here"; Assert.Zero(UserNotificationRepository.Get(user).Length); UserNotificationRepository.Create(user, title, content, UserNotificationType.Warning); var notifications = UserNotificationRepository.Get(user); Assert.AreEqual(1, notifications.Length); Assert.AreEqual(title, notifications[0].title); Assert.AreEqual(content, notifications[0].content); }
public static UserNotification NewNotification( User user, string title, string content, UserNotificationType type = UserNotificationType.Info ) { return(UserNotificationRepository.Create(user, title, content, type)); }