public void TestAdd() { mockNotificationRepository.Setup(x => x.Add(It.IsAny <Notification>())).Returns(notificationObject); var notificationService = new NotificationService.Services.NotificationService(mockNotificationRepository.Object); Notification notificationActual = notificationService.Add(notificationObject); Assert.AreEqual(notificationActual, notificationObject); }
public void TestGetNotifications() { IEnumerable <Notification> ienumable = notifications; mockNotificationRepository.Setup(x => x.GetNotifications(It.IsAny <string>())).Returns(ienumable); var notificationService = new NotificationService.Services.NotificationService(mockNotificationRepository.Object); IEnumerable <Notification> iEnumerablenotification = notificationService.GetNotifications("5d4d012613376b00013a8986"); Notification notificationActual = iEnumerablenotification.FirstOrDefault(); Assert.AreEqual(notificationActual.Id, "5d4d01261337124g23528986"); }