robdmoore/NQUnit — Issue #4: Index out of range exception
Author: jfoshee
Created: 2011-10-21 22:42:24+00:00
State: open

The InitializationException contains a System.IndexOutOfRangeException.

### StackTrace

```
at WatiN.Core.UtilityClasses.LazyList`1.get_Item(Int32 index)
at WatiN.Core.UtilityClasses.LazyList`1.System.Collections.Generic.IList.get_Item(Int32 index)
at WatiN.Core.BaseComponentCollection`2.get_Item(Int32 index)
at NQUnit.QUnitParser.d__f.MoveNext() in C:\Users\Rob\Documents\Visual Studio 2010\Projects\QUnitValidation\NQUnit\QUnitParser.cs:line 63
at System.Linq.Enumerable.d__14`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at NQUnit.NQUnit.<>c__DisplayClass2.b__1() in C:\Users\Rob\Documents\Visual Studio 2010\Projects\QUnitValidation\NQUnit\NQUnit.cs:line 54
```

### Test1.html

```html

QUnit example

test markup, will be hidden

```

### UnitTest1.cs
```C#
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var files = new string[] { "Test1.html" };
var tests = NQUnit.NQUnit.GetTests(30 * 1000, files);
foreach (var item in tests)
{
if (item.InitializationException != null)
throw new Exception("Intialization Exception", item.InitializationException);
Assert.AreEqual("pass", item.Result);
}
}
}
```

Thank you for sharing this work! I hope I can get it working. It's exactly what I've been looking for.

Cheers!