예제 #1
0
        protected override void OnSetup()
        {
            mockNotificationDataService = CreateMock <INotificationDataService>();
            mockLoggingHelper           = CreateMock <ILoggingHelper>();

            // mockNotificationDataService.Setup(x => x.AddNewNotification(It.IsAny<NotificationDTO>())).ReturnsAsync(1);
            mockNotificationDataService.Setup(x => x.CheckIfNotificationExists(It.IsAny <int>(), It.IsAny <string>())).ReturnsAsync(true);
            mockNotificationDataService.Setup(x => x.DeleteNotificationbyUDPRNAndAction(It.IsAny <int>(), It.IsAny <string>())).ReturnsAsync(1);
            // mockNotificationDataService.Setup(x => x.GetNotificationByUDPRN(It.IsAny<int>())).ReturnsAsync(new NotificationDTO() { });

            var rmTraceManagerMock = new Mock <IRMTraceManager>();

            rmTraceManagerMock.Setup(x => x.StartTrace(It.IsAny <string>(), It.IsAny <Guid>()));
            mockLoggingHelper.Setup(x => x.RMTraceManager).Returns(rmTraceManagerMock.Object);

            testCandidate = new NotificationBusinessService(mockNotificationDataService.Object, mockLoggingHelper.Object);
        }
 public NotificationsPageViewModel(INavigationService navigationService, ISettings settings, INotificationBusinessService notificationBusinessService) : base(navigationService, settings)
 {
     if (navigationService == null)
     {
         throw new ArgumentNullException("navigationService");
     }
     if (notificationBusinessService == null)
     {
         throw new ArgumentNullException("notificationBusinessService");
     }
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     _notificationBusinesservice = notificationBusinessService;
     _navigationService          = navigationService;
     _settings = settings;
 }
 public NotificationController(INotificationBusinessService notificationBusinessService, ILoggingHelper loggingHelper)
 {
     this.notificationBusinessService = notificationBusinessService;
     this.loggingHelper = loggingHelper;
 }