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());
        }
Пример #3
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());
        }
Пример #4
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());
        }