PapGroup / NSubstitute.FluentAssertionsBridge

a library for bridging between NSubstitute and FluentAssertions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

a library for bridging between NSubstitute and FluentAssertions

License:MIT License


Languages

Language:C# 53.7%Language:PowerShell 25.5%Language:Shell 20.8%