public void InitTest() { _userService = A.Fake <IUserService>(); _eventAggregator = A.Fake <IEventAggregator>(); _view = A.Fake <IUsersListView>(); _containter = A.Fake <IUnityContainer>(); _viewModel = new UsersListViewModel(_userService, _eventAggregator, _view, _containter); }
public UsersListViewModel(IUserService userService, IEventAggregator eventAggregator, IUsersListView view, IUnityContainer container) : base(view) { if (userService == null) { throw new ArgumentNullException("userService"); } _userService = userService; if (eventAggregator == null) { throw new ArgumentNullException("eventAggregator"); } _eventAggregator = eventAggregator; if (container == null) { throw new ArgumentNullException("container"); } _container = container; Title = "Users List"; //rejestrujemy się na zdarzenie zapisania danych użytkownika, aby dodać nowego użytkownika //do listy uzytkowników _eventAggregator.GetEvent <SavedUserEvent>().Subscribe(ProcessSavedUserMessage); }