Skip to content

PapGroup/NSubstitute.FluentAssertionsBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSubstitute.FluentAssertionsBridge

a library for bridging between NSubstitute and FluentAssertions in order to verify arguments of called methods using FluentAssertions.

Build

Branch Status
Master Build Status
Develop Build Status

Installation

Source Link
Nuget Nuget Version

Usage

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