You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.
public class ListWithProperty : List<int>
{
public string MyProperty { get; set; }
}
I can create two different instances, with different properties, set an expectation for the first one, and then pass in the second one and get the response I'd set up.
var class1 = MockRepository.GenerateMock<IClass1>();
var expectedList = new ListWithProperty{MyProperty = "A value"};
class1.Expect(x => x.GetPropertyFromList(expectedList)).Return("Fake Response");
var actualList = new ListWithProperty { MyProperty = "A completely different value" };
var response = class1.GetPropertyFromList(actualList);
Assert.AreEqual("Fake Response",response);
This is due to the line in Validate.cs RecursiveCollectionEqual if (expected is ICollection)
Which assumes that if an object is a collection and the items in the collection match then the items are the same. Which is not true in this case.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Given a class:
I can create two different instances, with different properties, set an expectation for the first one, and then pass in the second one and get the response I'd set up.
This is due to the line in Validate.cs RecursiveCollectionEqual
if (expected is ICollection)
Which assumes that if an object is a collection and the items in the collection match then the items are the same. Which is not true in this case.
The text was updated successfully, but these errors were encountered: