mardi 28 avril 2015

Index was outside the bounds of the array C# in unit test

I input my QuaterDisplay as dummy data, but I get the error as below:

Index was outside the bounds of the array.

Code:

private string GetQuarterDisplay(DateTime dateKey)
{
    return ((AvailabilityDS.IntelTimeRow[])mAvailabilityDS.Time.Select("DateKey = '"
            + dateKey + "'"))[0].QuarterDisplay; //error occur here
}

internal void PropagateModelStartQuarter() 
{
    object[] args = new object[0];
    m_privateObject.Invoke("PropagateModelStartQuarter", new System.Type[0], args);
}

Aucun commentaire:

Enregistrer un commentaire