public void Constructor_SetsNavigationMode()
        {
            MockNavigationEntry navigationEntry = new MockNavigationEntry() { PageName = "SamplePage" };
            PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(navigationEntry, NavigationMode.Forward);

            Assert.AreEqual(NavigationMode.Forward, eventArgs.NavigationMode);
        }
        public void Constructor_Exception_InvalidNavigationMode()
        {
            MockNavigationEntry navigationEntry = new MockNavigationEntry() { PageName = "SamplePage" };

            Assert.ThrowsException<ArgumentException>(() =>
            {
                PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(navigationEntry, (NavigationMode)100);
            });
        }
Exemple #3
0
        public async Task Activate_DoesNotCallPerformQueryIfSameQueryAsVisible()
        {
            MockNavigationEntry searchPageEntry = new MockNavigationEntry();
            MockNavigationManager navigationManager = new MockNavigationManager(_ => searchPageEntry);
            SearchManager searchManager = CreateSearchMananger(navigationManager: navigationManager);

            await searchManager.Activate(new MockSearchActivatedEventArgs() { QueryText = "MyQuery", Language = "en-GB" });

            CollectionAssert.AreEqual(new[] { Tuple.Create("MyQuery", "en-GB") }, (ICollection)((MockSearchPageElement)searchPageEntry.Page).Queries);
            CollectionAssert.AreEqual(new[] { Tuple.Create("MyQuery", "en-GB") }, (ICollection)((MockSearchPageElement)searchPageEntry.ViewModel).Queries);
        }
Exemple #4
0
        public async Task Activate_SuccessfulEvenWhenNoSearchPageImplementors()
        {
            MockNavigationEntry searchPageEntry = new MockNavigationEntry() { Page = new MockPageElement(), ViewModel = new MockPageElement() };
            MockNavigationManager navigationManager = new MockNavigationManager(_ => searchPageEntry);
            SearchManager searchManager = CreateSearchMananger(navigationManager: navigationManager);

            await searchManager.Activate(new MockSearchActivatedEventArgs() { QueryText = "MyQuery", Language = "en-GB" });
        }
Exemple #5
0
        public async Task Activate_CallsPerformQueryOnlyOnSearchPageImplementors()
        {
            MockNavigationEntry searchPageEntry = new MockNavigationEntry() { Page = new MockPageElement() };
            MockNavigationManager navigationManager = new MockNavigationManager(_ => searchPageEntry);
            SearchManager searchManager = CreateSearchMananger(navigationManager: navigationManager);

            await searchManager.Activate(new MockSearchActivatedEventArgs() { QueryText = "MyQuery", Language = "en-GB" });

            CollectionAssert.AreEqual(new[] { Tuple.Create("MyQuery", "en-GB") }, (ICollection)((MockSearchPageElement)searchPageEntry.ViewModel).Queries);
        }