M
Magnus.Moraberg
Hi,
I have the following class snippet -
public class ResultsForTestCases : IEnumerable
{
public int Length
{
get { return resultsForTestCases.Length; }
}
IEnumerator IEnumerable.GetEnumerator() { return
resultsForTestCases.GetEnumerator(); }
ResultsForTestCase[] resultsForTestCases;
}
The problem though is if resultsForTestCases is null, then
resultsForTestCases.GetEnumerator() and indeed Length will fail. How
should I handle this.
Thanks,
Barry
I have the following class snippet -
public class ResultsForTestCases : IEnumerable
{
public int Length
{
get { return resultsForTestCases.Length; }
}
IEnumerator IEnumerable.GetEnumerator() { return
resultsForTestCases.GetEnumerator(); }
ResultsForTestCase[] resultsForTestCases;
}
The problem though is if resultsForTestCases is null, then
resultsForTestCases.GetEnumerator() and indeed Length will fail. How
should I handle this.
Thanks,
Barry