public void SelectedProperty_Selected_NavigateToBunchPageAsyncShouldBeCalled() { Mock <INavigationService> mockNavigationService = new Mock <INavigationService>(); Mock <IRepository> mockRepository = new Mock <IRepository>(); var mainListPageModel = new MainListPageModel(mockNavigationService.Object, mockRepository.Object); var bunch = new Bunch("mango", "banana"); mockNavigationService.Setup(x => x.NavigateToBunchPageAsync(bunch)); mainListPageModel.Selected = bunch; mockNavigationService.Verify(x => x.NavigateToBunchPageAsync(bunch), Times.Once()); }
public MainListPage(INavigationService navigationService, IRepository repository) { InitializeComponent(); BindingContext = new MainListPageModel(navigationService, repository); }