Menu

[r6]: / trunk / NUnitWeb / HtmlElementTester.cs  Maximize  Restore  History

Download this file

108 lines (97 with data), 2.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
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.")
{
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.