Problem related to IndexOutOfRangeException
<p>I am getting the continuous error of IndexOutOfRangeException in my c# code. The code snippet is follows:</p>

<pre><code>public void GetAccountSalesDataTestWithAccountsIncluded()
{
    AccountSalesDataRepository target = new AccountSalesDataRepository();
    AccountSalesDataSearchCriteria[] searchCriteria = new AccountSalesDataSearchCriteria[2]
     {   
        new AccountSalesDataSearchCriteria
        {
             ProgramAccountId = new AccountSalesDataSearchCriteria.SearchCriteria&lt;int&gt;[1] { new AccountSalesDataSearchCriteria.SearchCriteria&lt;int&gt;(98, true) }
        },
        new AccountSalesDataSearchCriteria()
     };

    AccountSalesDataSummary[] results;
    results = target.GetAggregateAccountSalesData(searchCriteria, true);
    try
    {
        Assert.IsNotNull(results, "The result set should not be null with the given account");
        Assert.IsTrue(results.Length &gt; 0, "The result set should not be empty with given account");
    }
    catch (AssertFailedException /*ex*/)
    {
    }
    this.AccountSalesDataSummaryBasicTest(results, true);
    try
    {
        Assert.AreEqual(results[0].AccountId, 2);
        Assert.AreEqual(results[0].TotalPurchaseAmount, decimal.Parse("200"), "The total purchase amount is incorrect");
        Assert.AreEqual(results[0].TotalPurchaseQuantity, 2000, "The total purchase quantity is incorrect");
        Assert.AreEqual(results[0].TotalSaleQuantity, double.Parse("200"), "The total sales quantity is incorrect");
        Assert.AreEqual(results[0].TotalSalesAmount, decimal.Parse("20"), "The total sales amount is incorrect");
    }
    catch (AssertFailedException /*ex*/)
    {
    }
}
</code></pre>

<p>What can be the probable reason of this?</p>

<p>Please pardon me if I may give the idea that I am not coherent with my concepts, because I'm really new to this entire thing.</p>
