public MainWindowViewModel(IPersonService personService, IDispatcher dispatcher, IEventAggregator aggregator, IDialogService dialogService)
            : base(personService, dispatcher, aggregator, dialogService)
        {
            PersonDirectoryViewModel = new PersonDirectoryViewModel(personService, dispatcher, aggregator, dialogService);
            PersonDetailsViewModel = new PersonDetailsViewModel(personService, dispatcher, aggregator, dialogService);

            AppStartCommand = new AsyncCommand(PersonDirectoryViewModel.RefreshAsync);
        }
Example #2
0
        public MainWindowViewModel(IPersonService personService, IDispatcher dispatcher, IEventAggregator aggregator, IDialogService dialogService)
            : base(personService, dispatcher, aggregator, dialogService)
        {
            PersonDirectoryViewModel = new PersonDirectoryViewModel(personService, dispatcher, aggregator, dialogService);
            PersonDetailsViewModel   = new PersonDetailsViewModel(personService, dispatcher, aggregator, dialogService);

            AppStartCommand = new AsyncCommand(PersonDirectoryViewModel.RefreshAsync);
        }
        public void PersonDirectoryViewModel_WhenRefreshIsCalled_PersonDirectoryShouldBeUpdated()
        {
            //Arrange
            viewModel = new PersonDirectoryViewModel(personServiceMock.Object, dispatcherMock.Object, aggregatorMock.Object, dialogServiceMock.Object);

            //Act
            viewModel.RefreshAsync().Wait();

            //Assert
            CollectionAssert.AreEqual(persons, viewModel.PersonDirectory);
        }
        private void GivenPersonDirectory()
        {
            viewModel = new PersonDirectoryViewModel(personServiceMock.Object, dispatcherMock.Object, aggregatorMock.Object, dialogServiceMock.Object);

            viewModel.RefreshAsync().Wait();
        }
 private void GivenEmptyViewModel()
 {
     viewModel = new PersonDirectoryViewModel(personServiceMock.Object, dispatcherMock.Object, aggregatorMock.Object, dialogServiceMock.Object);
 }