Mockly documentation (including assertion usage) lives on https://mockly.org.
This repository contains only the FluentAssertions assertion packages for Mockly. For the core HTTP mocking library, see:
- Website: https://mockly.org
- Core repo: https://github.com/dennisdoomen/mockly
- Core NuGet package: https://www.nuget.org/packages/Mockly
Choose the package that matches your FluentAssertions major version:
| Package | FluentAssertions | NuGet |
|---|---|---|
FluentAssertions.Mockly.v7 |
7.x | https://www.nuget.org/packages/FluentAssertions.Mockly.v7 |
FluentAssertions.Mockly.v8 |
8.x | https://www.nuget.org/packages/FluentAssertions.Mockly.v8 |
Install Mockly and the assertion package you need:
dotnet add package Mockly
# Pick one:
dotnet add package FluentAssertions.Mockly.v7
dotnet add package FluentAssertions.Mockly.v8Example:
using System.Net;
using FluentAssertions;
using Mockly;
var mock = new HttpMock();
mock.ForGet()
.WithPath("/api/users/123")
.RespondsWithStatus(HttpStatusCode.OK);
var client = mock.GetClient();
var response = await client.GetAsync("/api/users/123");
response.StatusCode.Should().Be(HttpStatusCode.OK);
mock.Should().HaveAllRequestsCalled();./build.ps1Contributions are welcome! Please read CONTRIBUTING.md and open an issue or PR.
This repository uses Semantic Versioning. See the releases.
This project is licensed under the MIT License - see the LICENSE file for details.
