public async Task ClosesTheViewModelWithSelectedCountryCode() { var country = Substitute.For <ICountry>(); country.Id.Returns(1); country.Name.Returns("Greece"); country.CountryCode.Returns("GR"); await ViewModel.Initialize(); var selectableCountry = new SelectableCountryViewModel(country, true); ViewModel.SelectCountryCommand.Execute(selectableCountry); await NavigationService.Received() .Close(Arg.Is(ViewModel), country.Id); }
public async Task ClosesTheViewModelWithSelectedCountryCode() { var country = Substitute.For <ICountry>(); country.Id.Returns(1); country.Name.Returns("Greece"); country.CountryCode.Returns("GR"); await ViewModel.Initialize(null); var selectableCountry = new SelectableCountryViewModel(country, true); ViewModel.SelectCountry.Execute(selectableCountry); TestScheduler.Start(); (await ViewModel.Result).Should().Be(country.Id); }