using System;
using System.Collections;
using System.Collections.Generic;
using GeoAPI.Coordinates;
using GeoAPI.Diagnostics;
using GisSharpBlog.NetTopologySuite;
using NPack.Interfaces;
namespace GisSharpBlog.NetTopologySuite
{
///
/// Summary description for XmlTestCollection.
///
public class XmlTestCollection : List>
where TCoordinate : ICoordinate, IEquatable,
IComparable, IConvertible,
IComputable
{
#region Private Members
private String m_strCollectionName;
#endregion
#region Events
public event XmlTextEventHandler TestEvent;
#endregion
#region Constructors and Destructors
public XmlTestCollection()
{
m_strCollectionName = String.Empty;
}
#endregion
#region Public Properties
//public XmlTest this[Int32 index]
//{
// get { return (XmlTest)List[index]; }
// set { List[index] = value; }
//}
public String Name
{
get { return m_strCollectionName; }
set { m_strCollectionName = value; }
}
#endregion
#region Public Methods
//public Int32 Add(XmlTest value)
//{
// return List.Add(value);
//}
//public Int32 IndexOf(XmlTest value)
//{
// return List.IndexOf(value);
//}
//public void Insert(Int32 index, XmlTest value)
//{
// List.Insert(index, value);
//}
//public void Remove(XmlTest value)
//{
// List.Remove(value);
//}
public Boolean RunTests()
{
if (Count > 0)
{
for (Int32 i = 0; i < Count; i++)
{
XmlTest testItem = this[i];
if (testItem != null)
{
RunTest(i);
}
}
return true;
}
return false;
}
public bool RunTest(int index)
{
if (Count > index)
{
XmlTest testItem = this[index];
if (testItem != null)
{
Boolean succeeded = testItem.Run();
XmlTestEventArgs args = new XmlTestEventArgs(index, succeeded, testItem);
if (TestEvent != null)
{
TestEvent(this, args);
}
return succeeded;
}
}
return false;
}
#endregion
}
}