public NotificationPresenter(INotificationView view, IRegionResolver regionResolver, IUserSettings userSettings, INotificationMessageMapper notificationMessageMapper, IViewItemContextMenuFactory viewItemContextMenuFactory, IMoBiApplicationController applicationController, IMoBiContext context, IDialogCreator dialogCreator) : base(view) { _regionResolver = regionResolver; _userSettings = userSettings; _notificationMessageMapper = notificationMessageMapper; _viewItemContextMenuFactory = viewItemContextMenuFactory; _applicationController = applicationController; _context = context; _dialogCreator = dialogCreator; VisibleNotification = _userSettings.VisibleNotification; }
protected override void Context() { _view = A.Fake <INotificationView>(); _buildingBlock = A.Fake <IBuildingBlock>(); _region = A.Fake <IRegion>(); _userSettings = A.Fake <IUserSettings>(); _viewItemContextMenuFactory = A.Fake <IViewItemContextMenuFactory>(); _userSettings.VisibleNotification = _settingsToUse; _regionResolver = A.Fake <IRegionResolver>(); _buildingBlockRetriever = A.Fake <IBuildingBlockRetriever>(); _applicationController = A.Fake <IMoBiApplicationController>(); _context = A.Fake <IMoBiContext>(); _dialogCreator = A.Fake <IDialogCreator>(); _notificationMessageMapper = new NotificationMessageMapper(new ObjectTypeResolver(), _buildingBlockRetriever); A.CallTo(() => _regionResolver.RegionWithName(RegionNames.NotificationList)).Returns(_region); sut = new NotificationPresenter(_view, _regionResolver, _userSettings, _notificationMessageMapper, _viewItemContextMenuFactory, _applicationController, _context, _dialogCreator); A.CallTo(() => _view.BindTo(A <NotifyList <NotificationMessageDTO> > ._)) .Invokes(x => _allNotifications = x.GetArgument <IEnumerable <NotificationMessageDTO> >(0)); sut.Initialize(); }