コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }