public void UserCanNotViewAdminSectionTest()
 {
     using (DnkBrowser browser = new DnkBrowser()) {
         browser.UserLogin().GoToAdmin();
         Assert.IsTrue(browser.IsNotAuthorisedPage);
     }
 }
 public void AdministratorCanViewAdminSectionTest()
 {
     using (DnkBrowser browser = new DnkBrowser()) {
         browser.AdminLogin().GoToAdmin();
         Assert.IsTrue(browser.IsAdminPage);
     }
 }
 public void ValidUserCredentialsCanLoginTest(string username, string password)
 {
     using (DnkBrowser browser = new DnkBrowser()) {
         browser.Login(username, password);
         Assert.IsTrue(Regex.IsMatch(browser.Html, String.Format(@"Welcome <a href=""/users/{0}"">{0}</a>", username), RegexOptions.IgnoreCase));
     }
 }
 public void InValidUserCredentialsCanNotLoginTest(string username, string password)
 {
     using (DnkBrowser browser = new DnkBrowser()) {
         browser.Login(username, password);
         Assert.IsTrue(Regex.IsMatch(browser.Html, "Username and password do not match", RegexOptions.IgnoreCase));
     }
 }
 public void KickItImageIsGeneratedForNonExistantStoryTest()
 {
     using (DnkBrowser browser = new DnkBrowser()) {
         browser.GoTo(browser.RootUrl + "Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.doesnotexist.com");
         Assert.IsTrue(browser.RootUrl != null);
         Assert.IsTrue(browser.Images.Length == 1);
     }
 }
 public void KickItImageIsGeneratedForExistantStoryTest()
 {
     using (DnkBrowser browser = new DnkBrowser()) {
         browser.GoTo(browser.RootUrl + "Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fnews.bbc.co.uk%2fsport2%2fhi%2frugby_union%2fwelsh%2f6996579.stm");
         Assert.IsTrue(browser.RootUrl != null);
         Assert.IsTrue(browser.Images.Length == 1);
     }
 }
 public void SetUp()
 {
     using (DnkBrowser ie = new DnkBrowser().Logout()) { } //ensure the user is logged out
 }