b341ed6ff8 | ||
---|---|---|
.github | ||
src | ||
.gitignore | ||
license.txt | ||
readme.md |
readme.md
Verify.FakeItEasy
Adds Verify support for verifying FakeItEasy types.
See Milestones for release notes.
NuGet package
https://nuget.org/packages/Verify.FakeItEasy/
Usage
[ModuleInitializer]
public static void Init() =>
VerifyFakeItEasy.Initialize();
Given an interface:
public interface ITarget
{
void Method(int a, int b);
}
Its .GetCalls()
can be verified:
[Fact]
public Task ReceivedCalls()
{
var target = A.Fake<ITarget>();
target.Method(1, 2);
var calls = Fake.GetCalls(target);
return Verify(calls);
}
Will result in:
[
{
Method: ITarget.Method(int a, int b),
Arguments: [
1,
2
]
}
]
A instance of FakeManager
can also be verified.
[Fact]
public Task FakeManager()
{
var target = A.Fake<ITarget>();
target.Method(1, 2);
var fakeManager = Fake.GetFakeManager(target);
return Verify(fakeManager);
}