using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using NUnit.Extensions.Web.HtmlDom;
namespace NUnit.Extensions.Web
{
public class HtmlElementTester : Tester
{
protected string m_name;
//protected FormSearchCriteria m_formSearch;
//public HtmlElementTester
//(
// WebBrowser brsr,
// IElementLocator locator,
// FormSearchCriteria frmsearch,
// string name
//)
// : base(brsr, locator)
//{
// m_name = name;
// m_formSearch = frmsearch;
//}
public HtmlElementTester
(
WebBrowser brsr,
IElementLocator locator,
string name
)
: base(brsr, locator)
{
m_name = name;
//m_formSearch = null;
}
public override string IdOrName
{
get
{
return m_name;
}
}
public Form Form
{
get
{
//if (null == m_formSearch)
//{
return m_locator.Form;
//}
//return m_formSearch.LocateForm(Document);
}
}
public virtual bool Enabled
{
get
{
return!Tag.HasAttribute("disabled");
}
}
}
/// <summary>
/// The test asked a list what item was selected when multiple items were selected.
/// Modify the test to look at the Selected property of individual list items, or
/// fix the production code so that only one item is selected.
/// </summary>
public class MultipleSelectionException : ApplicationException
{
internal MultipleSelectionException()
: base("Multiple list items are selected.")
{
}
}
/// <summary>
/// The index of the list was set to a value that doesn't correspond to a
/// list item. Fix the test so that it sets the value correctly, or fix the production
/// code so that it generates the correct number of list items.
/// </summary>
public class IllegalInputException : ApplicationException
{
internal IllegalInputException(string message)
: base(message)
{
}
}
/// <summary>
/// The test asked a list what item was selected when no items were selected.
/// Fix the test so that it doesn't ask the question, or fix the production code so
/// that a list item is selected.
/// </summary>
public class NoSelectionException : ApplicationException
{
internal NoSelectionException()
: base("None of the list items have been selected.")
{
}
}
}