Skip to content

Adds Verify support for verifying FakeItEasy types.

License

Notifications You must be signed in to change notification settings

VerifyTests/Verify.FakeItEasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify.FakeItEasy

Discussions Build status NuGet Status

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();

snippet source | anchor

Given an interface:

public interface ITarget
{
    void Method(int a, int b);
}

snippet source | anchor

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);
}

snippet source | anchor

Will result in:

[
  {
    Method: ITarget.Method(int a, int b),
    Arguments: [
      1,
      2
    ]
  }
]

snippet source | anchor

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);
}

snippet source | anchor

About

Adds Verify support for verifying FakeItEasy types.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •  

Languages