I have a method that is called twice. However, each time I call this method I would like to change the value on a property. Below gives a simple explanation of what I am trying to achieve.
Actual C# method to test
public void SomeMethod(string val1, string val2)
{
var results1 = MyInterface.GetObjectResults(val1);
foreach (record in results1)
{
var results2 = MyInterface.GetObjectResults(val2); // same method as above
if (results2.MyProperty != record.MyProperty)
{
// TODO:
}
}
}
If I stub the MyInterface.GetObjectResults two times the results will be the same regardless of what values gets passed inside the method. How can I stub this method differently so that both MyProperty value is not return to be the same? Any help is greatly appreciated.