explain my self beter something like this
public void AssertRowCellDisplayText()
{
mockController.AlwaysReturn("RelationCount",1);
mockController.AlwaysReturn("IsEmpty",false);
currentViewIndex=0;
int i=0;
foreach (string key in Properties.LevelDefaults.Keys)
{
mockController.ExpectAndReturn("RelationName",key).Args(new ParameterChecker(CheckView));
mockController.ExpectAndReturn("RelationName",key).Args(new ParameterChecker(CheckView));
mockController.ExpectAndReturn("ChildList",xpCollections[i]).Args(
new ParameterChecker(CheckView));
mockController.AfterVerification+=new EventHandler(MethodName);
i+=1;
}
AssertRowCellDisplayText(xpBaseObjects,exludedColumns);
}
public void MethodName(object sender,EventArgs e)
{
if (e.ExpectedMethod=="ChildList")
currentViewIndex+=1;
}
int currentViewIndex=0;
public bool CheckView(object parameter)
{
bool equals = Properties.Views[currentViewIndex].Equals(parameter);
return equals;
}
at the 1st loop Properties.Views contains only 1 item the 2nd item is added after succefull
mockController.ExpectAndReturn("ChildList",xpCollections[i]).Args(
new ParameterChecker(CheckView));
i m sure u can implemented better than i did but i just try to make my self understandable