a library for bridging between NSubstitute and FluentAssertions in order to verify arguments of called methods using FluentAssertions.
Branch | Status |
---|---|
Master | |
Develop |
Source | Link |
---|---|
Nuget |
The library provides a static method called 'Verify.That' that takes an 'Action' parameter for passing an assertion. For example, the following code verifies that 'Register' method called with expected object one time :
using PAP.NSubstitute.FluentAssertionsBridge;
...
var service = Substitute.For<IRegistrationService>();
var expected = new RegistrationModel(){ Username = "Admin", Password="123456" };
...
...
service.Received(1).Register(Verify.That<RegistrationModel>(a=> a.Should().BeEquivalentTo(expected)));