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"); }); }
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"); }); }
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 }); }
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"); }); }
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"); }); }
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"); }); }
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"); }); }
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"); }); }
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 }); }
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"); }); }