Codeo.CQRS.Testability
2.0.6
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Codeo.CQRS.Testability --version 2.0.6
NuGet\Install-Package Codeo.CQRS.Testability -Version 2.0.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Codeo.CQRS.Testability" Version="2.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Codeo.CQRS.Testability --version 2.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Codeo.CQRS.Testability, 2.0.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Codeo.CQRS.Testability as a Cake Addin #addin nuget:?package=Codeo.CQRS.Testability&version=2.0.6 // Install Codeo.CQRS.Testability as a Cake Tool #tool nuget:?package=Codeo.CQRS.Testability&version=2.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Codeo.CQRS.Testability
This is a library to make testing code using Codeo.CQRS a little more convenient, specifically:
- fluent extension methods for IQueryExecutor and ICommandExecutor to mock calls for
NSubstitute substitutes:
queryExecutor.WithMocked<TQuery, TResult>(...)
commandExecutor.WithMocked<TCommand, TResult>(...)
Suggested use is as follows:
var queryExecurtor = Substitute.For<IQueryExecutor>()
.WithMocked<SomeQuery, SomeResult>(
// see the tests for examples
).WithMocked<AnotherQUery, AnotherResult>(
...
);
var commandExecutor = Substitute.For<ICommandExecutor>()
.WithMocked<SomeCommand, SomeResult>(
// see tests for examples
).WithMocked<AnotherCommand, AnotherResult>(
...
);
Commands and queries can have their results mocked in the following ways:
- With a constant result for all usages
var expected = new SomeResult();
var queryExecutor = Substitute.For<IQueryExecutor>()
.WithMocked<SomeQuery, SomeResult>(expected);
- With a constant result based on the incoming command/query
var expected = new SomeResult();
var queryExecutor = Substitute.For<IQueryExecutor>()
.WithMocked<SomeQuery, SomeResult>(
q => q.SomeParameter == 1,
expected
);
- With full control over mock selection and logic
var expected = new SomeResult();
var queryExecutor = Substitute.For<IQueryExecutor>()
.WithMocked<SomeQuery, SomeResult>(
q => q.SomeParameter == 1,
q =>
{
// ... perform some other logic
return expected;
}
);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- Codeo.CQRS (>= 2.0.6)
- NExpect (>= 2.0.92)
- NExpect.Matchers.NSubstitute (>= 2.0.92)
- NSubstitute (>= 5.1.0)
-
.NETStandard 2.0
- Codeo.CQRS (>= 2.0.6)
- NExpect (>= 2.0.92)
- NExpect.Matchers.NSubstitute (>= 2.0.92)
- NSubstitute (>= 5.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.1-2405131632.de93f97 | 54 | 5/13/2024 |
2.0.7-2405131630.0dc307a | 53 | 5/13/2024 |
2.0.6 | 97 | 5/13/2024 |
2.0.5 | 105 | 5/13/2024 |
2.0.4 | 93 | 5/13/2024 |
2.0.3 | 88 | 5/13/2024 |
2.0.2-2401300909.d88d96f | 82 | 1/30/2024 |
2.0.2-2401300900.34b68ae | 50 | 1/30/2024 |
2.0.2-2401300843.6cf7ae8 | 57 | 1/30/2024 |
2.0.2-2401251650.6cf7ae8 | 61 | 1/25/2024 |
2.0.2-2401251211.9248f56 | 51 | 1/25/2024 |
2.0.2-2401241329.7f6eeb8 | 63 | 1/24/2024 |
2.0.2-2401221540.eb57813 | 64 | 1/22/2024 |
2.0.1 | 140 | 1/22/2024 |
2.0.1-2401121158.cc4a0cd | 75 | 1/12/2024 |