Last active
December 14, 2015 11:09
-
-
Save adamralph/5076908 to your computer and use it in GitHub Desktop.
FakeItEasy Should_match_lambda_arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Should_match_lambda_arguments() | |
{ | |
// Arrange | |
var fake = A.Fake<ITypeWithMethodWithDelegateParameter>(); | |
var action = (Action)(() => { }); | |
var other = (Action)(() => { }); | |
// Act | |
fake.Foo(action); | |
// Assert | |
A.CallTo(() => fake.Foo(action)).MustHaveHappened(); | |
A.CallTo(() => fake.Foo(other)).MustNotHaveHappened(); | |
} | |
public interface ITypeWithMethodWithDelegateParameter | |
{ | |
void Foo(Action action); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment