blob: 2ca32577e60df067295109c569f34959931087bb [file] [log] [blame]
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Threading;
namespace Selenium.Tests
{
[TestFixture]
public class TestErrorChecking : SeleniumTestCaseBase
{
[Test]
public void ShouldAllowErrorChecking()
{
selenium.Open("../tests/html/test_click_page1.html");
// These tests should all fail, as they are checking the error checking commands.
try { Assert.AreEqual(selenium.GetText("link"), "Click here for next page"); Assert.Fail("expected failure"); } catch (Exception) {}
try { Console.WriteLine("foo"); Assert.Fail("expected failure"); } catch (Exception) {}
try { Assert.AreEqual(selenium.GetText("link"), "foo"); Assert.Fail("expected failure"); } catch (Exception) {}
try { Assert.AreEqual(selenium.GetText("link"), "Click here for next page"); Assert.Fail("expected failure"); } catch (Exception) {}
try { Assert.AreEqual(selenium.GetText("link"), "foo"); Assert.Fail("expected failure"); } catch (Exception) {}
try { Assert.AreEqual(selenium.GetText("notAlink"), "foo"); Assert.Fail("expected failure"); } catch (Exception) {}
}
}
}