Exemplo n.º 1
0
		public void AbsoluteUri_EmptyTarget ()
		{
			MyHyperlinkButton hlb = new MyHyperlinkButton();
			hlb.NavigateUri = new Uri("http://www.ireland.com", UriKind.Absolute);
			hlb.TargetName = "";
			Canvas root = new Canvas();
			root.Children.Add(hlb);

			CreateAsyncTest(root, () =>  {
				Assert.DoesNotThrow(() => hlb.Clickify(), "#1");
			});
		}
Exemplo n.º 2
0
        public void AbsoluteUri_SelfTarget()
        {
            MyHyperlinkButton hlb = new MyHyperlinkButton();

            hlb.NavigateUri = new Uri("http://www.ireland.com", UriKind.Absolute);
            hlb.TargetName  = "_self";
            Canvas root = new Canvas();

            root.Children.Add(hlb);

            CreateAsyncTest(root, () => {
                Assert.DoesNotThrow(() => hlb.Clickify(), "#1");
            });
        }
Exemplo n.º 3
0
        public void RelativeNullUrisAllowedTest()
        {
            MyHyperlinkButton hlb = new MyHyperlinkButton();

            hlb.NavigateUri = null;
            hlb.TargetName  = "";
            Canvas root = new Canvas();

            root.Children.Add(hlb);

            CreateAsyncTest(root, () => {
                hlb.Clickify();                  // make sure it doesn't throw
            });
        }
Exemplo n.º 4
0
        public void RelativeEmptyUrisAllowedTest_TargetSelf()
        {
            MyHyperlinkButton hlb = new MyHyperlinkButton();

            hlb.NavigateUri = new Uri("", UriKind.Relative);
            hlb.TargetName  = "_self";
            Canvas root = new Canvas();

            root.Children.Add(hlb);

            CreateAsyncTest(root, () => {
                Assert.DoesNotThrow(() => hlb.Clickify(), "#1");
            });
        }
Exemplo n.º 5
0
        public void RelativeUrisNotAllowedTest_SelfTarget()
        {
            MyHyperlinkButton hlb = new MyHyperlinkButton();

            hlb.NavigateUri = new Uri("Relative", UriKind.Relative);
            hlb.TargetName  = "_self";
            Canvas root = new Canvas();

            root.Children.Add(hlb);

            CreateAsyncTest(root, () => {
                Assert.Throws <NotSupportedException>(() => hlb.Clickify(), "Relative URI test");
            });
        }
Exemplo n.º 6
0
        public void DeepLinkingNoTargetNameTest()
        {
            MyHyperlinkTarget target = new MyHyperlinkTarget();
            MyHyperlinkButton hlb    = new MyHyperlinkButton();

            hlb.NavigateUri = new Uri("DeepLink", UriKind.Relative);

            Canvas root = new Canvas();

            root.Children.Add(target);
            root.Children.Add(hlb);

            CreateAsyncTest(root, () => {
                hlb.Clickify();
                Assert.IsTrue(target.Navigated, "Deep linked target navigation");
            });
        }
Exemplo n.º 7
0
		public void RelativeUrisNotAllowedTest_EmptyTarget ()
		{
			MyHyperlinkButton hlb = new MyHyperlinkButton ();
			hlb.NavigateUri = new Uri ("Relative", UriKind.Relative);
			hlb.TargetName = "";
			Canvas root = new Canvas ();
			root.Children.Add (hlb);

			CreateAsyncTest (root, () => {
				Assert.Throws<NotSupportedException>(() => { hlb.Clickify (); }, "Relative URI test");
			});
		}
Exemplo n.º 8
0
		public void DeepLinkingNoTargetNameTest ()
		{
			MyHyperlinkTarget target = new MyHyperlinkTarget ();
			MyHyperlinkButton hlb = new MyHyperlinkButton ();
			hlb.NavigateUri = new Uri ("DeepLink", UriKind.Relative);
			
			Canvas root = new Canvas ();
			root.Children.Add (target);
			root.Children.Add (hlb);

			CreateAsyncTest (root, () => {
				hlb.Clickify ();
				Assert.IsTrue (target.Navigated, "Deep linked target navigation");
			});
		}
Exemplo n.º 9
0
		public void RelativeNullUrisAllowedTest ()
		{
			MyHyperlinkButton hlb = new MyHyperlinkButton ();
			hlb.NavigateUri = null;
			hlb.TargetName = "";
			Canvas root = new Canvas ();
			root.Children.Add (hlb);
			
			CreateAsyncTest (root, () => {
				hlb.Clickify (); // make sure it doesn't throw
			});
		}
Exemplo n.º 10
0
		public void RelativeEmptyUrisAllowedTest_TargetSelf()
		{
			MyHyperlinkButton hlb = new MyHyperlinkButton();
			hlb.NavigateUri = new Uri("", UriKind.Relative);
			hlb.TargetName = "_self";
			Canvas root = new Canvas();
			root.Children.Add(hlb);

			CreateAsyncTest(root, () => {
				Assert.DoesNotThrow (() => hlb.Clickify(), "#1");
			});
		}