Skip to content

AutoFixture.AutoRhinoMocks is a .NET library that integrates AutoFixture with Rhino Mocks, transforming it into an auto-mocking container.

License

Notifications You must be signed in to change notification settings

AutoFixture/AutoFixture.AutoRhinoMocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoFixture.AutoRhinoMocks

License NuGet version NuGet preview version NuGet downloads

AutoFixture.AutoRhinoMock is an extension for AutoFixture that turns your fixture into an auto-mocking container using Rhino Mocks. It automates the creation of mocks for abstract classes and interfaces, letting you focus on your test's intent instead of tedious setup.

Table of Contents

Installation

AutoFixture packages are distributed via NuGet.
To install the packages you can use the integrated package manager of your IDE, the .NET CLI, or reference the package directly in your project file.

dotnet add package AutoFixture.AutoRhinoMocks --version x.x.x
<PackageReference Include="AutoFixture.AutoRhinoMocks" Version="x.x.x" />

AutoFixture offers a variety of utility packages and integrations with most of the major mocking libraries and testing frameworks.

Getting Started

Basic Usage

Simply install the NuGet package and customize your fixture:

// Customize the fixture to use Rhino Mocks:
var fixture = new Fixture().Customize(new AutoRhinoMockCustomization());

// Freeze a dependency to configure its behavior:
var fooMock = (IMockedObject)fixture.Freeze<IFoo>();

// Create your SUT; its dependencies are auto-mocked using Rhino Mocks:
var sut = fixture.Create<MyService>();

Integrations

AutoFixture offers a variety of utility packages and integrations with most of the major mocking libraries and testing frameworks.

Note

Since AutoFixture tries maintain compatibility with a large number of package versions, the packages bundled with AutoFixture might not contain the latest features of your (e.g. mocking) library.
Make sure to install the latest version of the integrated library package, alongside the AutoFixture packages.

Core packages

The core packages offer the full set of AutoFixture's features without requring any testing framework or third party integration.

Product Package Stable Preview Downloads
The core package AutoFixture NuGet NuGet NuGet
Assertion idioms AutoFixture.Idioms NuGet NuGet NuGet
Seed extensions AutoFixture.SeedExtensions NuGet NuGet NuGet

Mocking libraries

AutoFixture offers integations with most major .NET mocking libraries.
These integrations enable such features as configuring mocks, auto-injecting mocks, etc.

Product Package Stable Preview Downloads
Moq AutoFixture.AutoMoq NuGet NuGet NuGet
NSubstitute AutoFixture.AutoNSubstitute NuGet NuGet NuGet
FakeItEasy AutoFixture.AutoFakeItEasy NuGet NuGet NuGet
Rhino Mocks AutoFixture.AutoRhinoMocks NuGet NuGet NuGet

Testing frameworks

AutoFixture offers integrations with most major .NET testing frameworks.
These integrations enable auto-generation of test cases, combining auto-generated data with inline arguments, etc.

Product Package Stable Preview Downloads
xUnit v3 AutoFixture.Xunit3 NuGet NuGet NuGet
xUnit v2 AutoFixture.Xunit2 NuGet NuGet NuGet
xUnit v1 AutoFixture.Xunit NuGet NuGet NuGet
NUnit v4 AutoFixture.NUnit4 NuGet NuGet NuGet
NUnit v3 AutoFixture.NUnit3 NuGet NuGet NuGet
NUnit v2 AutoFixture.NUnit2 NuGet NuGet NuGet
Foq AutoFixture.AutoFoq NuGet NuGet NuGet

You can check the compatibility with your target framework version on the wiki or on the NuGet website.

Contributing

Contributions are welcome! If you would like to contribute, please review our contributing guidelines and open an issue or pull request.

License

AutoFixture is Open Source software and is released under the MIT license.
The licenses allows the use of AutoFixture libraries in free and commercial applications and libraries without restrictions.

.NET Foundation

This project is supported by the .NET Foundation.

About

AutoFixture.AutoRhinoMocks is a .NET library that integrates AutoFixture with Rhino Mocks, transforming it into an auto-mocking container.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 7