Beispiel #1
0
        public void OnNavigatingTo()
        {
            var navigationService = new Mock <INavigationService>();
            var editExpense       = new Mock <IEditExpense>();
            var actual            = new AddExpensePageViewModel(navigationService.Object, editExpense.Object);

            actual.OnNavigatingTo(null);

            editExpense.Verify(m => m.InitializeAsync(), Times.Once);
        }
Beispiel #2
0
        public void OnNavigatingToForUpdate()
        {
            var navigationService = new Mock <INavigationService>();
            var editExpense       = new Mock <IEditExpense>();
            var actual            = new AddExpensePageViewModel(navigationService.Object, editExpense.Object);

            var navigationParameters = new NavigationParameters();

            navigationParameters[AddExpensePageViewModel.ExpenseIdKey] = "expenseId";
            actual.OnNavigatingTo(navigationParameters);

            editExpense.Verify(m => m.InitializeAsync("expenseId"), Times.Once);
        }