public BaseTestContext()
 {
     this.DataService                 = new MockDataService();
     this.BookmarkService             = new MockBookmarkService();
     this.NavigationService           = new MockNavigationService();
     this.savedSynchronizationContext = SynchronizationContext.Current;
     SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
 }
        public void HistoryExtendedAfterNavigation()
        {
            var service = new MockNavigationService();

            service.Navigate("ONE");
            Assert.AreEqual("ONE", service.History.First().Location);
            Assert.AreEqual(1, service.History.Count());

            service.Navigate("TWO");
            Assert.AreEqual("TWO", service.History.First().Location);
            Assert.AreEqual(2, service.History.Count());

            service.Navigate("THREE", new Dictionary<string, object> { { "Param", "Value" } });
            Assert.AreEqual("Value", service.History.First().Parameters["Param"]);
            Assert.AreEqual(3, service.History.Count());
        }
        public void CurrentSetAfterNavigation()
        {
            var service = new MockNavigationService();

            service.Navigate("ONE");
            Assert.AreEqual("ONE", service.Current.Location);

            service.Navigate("TWO");
            Assert.AreEqual("TWO", service.Current.Location);

            service.Navigate("THREE", new Dictionary<string, object> { { "Param", "Value" }});
            Assert.AreEqual("Value", service.Current.Parameters["Param"]);

            service.Navigate("FOUR");
            Assert.IsFalse(service.Current.Parameters.Any());
        }
Esempio n. 4
0
        public void HistoryExtendedAfterNavigation()
        {
            var service = new MockNavigationService();

            service.Navigate("ONE");
            Assert.AreEqual("ONE", service.History.First().Location);
            Assert.AreEqual(1, service.History.Count());

            service.Navigate("TWO");
            Assert.AreEqual("TWO", service.History.First().Location);
            Assert.AreEqual(2, service.History.Count());

            service.Navigate("THREE", new Dictionary <string, object> {
                { "Param", "Value" }
            });
            Assert.AreEqual("Value", service.History.First().Parameters["Param"]);
            Assert.AreEqual(3, service.History.Count());
        }
Esempio n. 5
0
        public void CurrentSetAfterNavigation()
        {
            var service = new MockNavigationService();

            service.Navigate("ONE");
            Assert.AreEqual("ONE", service.Current.Location);

            service.Navigate("TWO");
            Assert.AreEqual("TWO", service.Current.Location);

            service.Navigate("THREE", new Dictionary <string, object> {
                { "Param", "Value" }
            });
            Assert.AreEqual("Value", service.Current.Parameters["Param"]);

            service.Navigate("FOUR");
            Assert.IsFalse(service.Current.Parameters.Any());
        }
Esempio n. 6
0
        public void HistoryIsEmptyAtFirst()
        {
            var service = new MockNavigationService();

            Assert.IsFalse(service.History.Any());
        }
Esempio n. 7
0
        public void CurrentIsNullAtFirst()
        {
            var service = new MockNavigationService();

            Assert.IsNull(service.Current);
        }
 public void HistoryIsEmptyAtFirst()
 {
     var service = new MockNavigationService();
     Assert.IsFalse(service.History.Any());
 }
 public void CurrentIsNullAtFirst()
 {
     var service = new MockNavigationService();
     Assert.IsNull(service.Current);
 }