Exemplo n.º 1
0
        public void OnNavigatedFrom_With_No_RestorableStateAttributes()
        {
            var vm = new MockViewModelWithNoRestorableStateAttributes()
            {
                Title = "MyMock",
                Description = "MyDescription",
            };

            var result = new Dictionary<string, object>();

            vm.OnNavigatedFrom(result, true);

            Assert.IsTrue(result.Keys.Count == 0);
        }
Exemplo n.º 2
0
        public void OnNavigatedTo_With_No_RestorableStateAttributes()
        {
            var viewModelState = new Dictionary<string, object>();
            viewModelState.Add("Title", "MyMock");
            viewModelState.Add("Description", "MyDescription");

            var viewState = new Dictionary<string, object>();
            viewState.Add("Tests.Mocks.MockViewModelWithNoResumableStateAttributes1", viewModelState);

            var vm = new MockViewModelWithNoRestorableStateAttributes();
            vm.OnNavigatedTo(null, NavigationMode.Back, viewState);

            Assert.IsNull(vm.Title);
            Assert.IsNull(vm.Description);
        }