Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhenArgumentsMatch executes before Where #1

Closed
patrik-hagne opened this issue Jul 21, 2011 · 0 comments
Closed

WhenArgumentsMatch executes before Where #1

patrik-hagne opened this issue Jul 21, 2011 · 0 comments
Labels

Comments

@patrik-hagne
Copy link
Member

http://code.google.com/p/fakeiteasy/issues/detail?id=14

The folowing code generate an exception :

public interface ISetOnly
{
    int MyProperty { set; }

    bool MyProperty2 {set;}
}

[Test]
public void MyProperty_CanBeVerified()
{
    var setOnly = A.Fake<ISetOnly>();

    setOnly.MyProperty = 1;
    setOnly.MyProperty2 = false;

    A.CallTo(setOnly).Where(x => x.Method.Name == "set_MyProperty")
        .WhenArgumentsMatch(x => x.Get<int>(0) == 1).MustHaveHappened();
}

It looks like filtering with "Where(x => x.Method.Name ...)" doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants