public void OnNavigateTo_LoadsDefault_IfTryLoadDefaultTrue() { var defaultAddress = new Address { FirstName = "FirstName", State = "WA" }; var checkoutDataRepository = new MockCheckoutDataRepository(); checkoutDataRepository.GetDefaultBillingAddressAsyncDelegate = () => Task.FromResult(defaultAddress); var locationService = new MockLocationService(); var resourceLoader = new MockResourceLoader(); var target = new BillingAddressUserControlViewModel(checkoutDataRepository, locationService, resourceLoader, null); target.OnNavigatedTo(new NavigatedToEventArgs { Parameter = null, NavigationMode = NavigationMode.New }, new Dictionary<string, object>()); Assert.IsNull(target.Address.FirstName); target.SetLoadDefault(true); target.OnNavigatedTo(new NavigatedToEventArgs { Parameter = null, NavigationMode = NavigationMode.New }, new Dictionary<string, object>()); Assert.AreEqual("FirstName", target.Address.FirstName); }