30 packages tagged with “automock”
Automock implementation using Ninject to create the objects under test.
Automock implementation for Moq using Ninject to create the objects under test.
AutoMocker for use with NSubstitute
Accelerates preparation of mocked structures for unit tests under xUnit2 by configuring AutoFixture data generation to use Moq. Gracefully handles recursive structures by omitting recursions.
Automock implementation for NSubstitute using Ninject to create the objects under test.
Automock implementation for RhinoMocks using Ninject to create the objects under test.
Accelerates preparation of mocked structures for unit tests under xUnit2 by configuring AutoFixture data generation to use NSubstitute. Gracefully handles recursive structures by omitting recursions.
Automock implementation for FakeItEasy using Ninject to create the objects under test.
When writing unit tests for any code that uses dependency injection, and when using a mocking framework, we need to declare and inject any dependency we have. This is repetitive and boring code to write, especially on classes with many dependencies. AutoMock solves this by creating mocks/stubs on the fly for a given class together with an instance of it.
Speed up your unit test writing by using this helper that leverages AutoMocker to automatically mock dependencies.
An automocker for FakeItEasy. Can mock concerete dependencies as well as interfaces.
Accelerates preparation of mocked structures for unit tests under xUnit2 by configuring AutoFixture data generation to use FakeItEasy. Gracefully handles recursive structures by omitting recursions.
Automatically Moq dependencies encountered through Splat's Locator.
Base classes and extension classes for building Unit tests based on XUnit and Given-When-Then pattern
Library which allows to seemlesly mock Moq dependencies for more simpler unit tests.
Library which allows to seemlesly mock dependencies for unit tests.
Library which allows to seemlesly mock FakeItEasy dependencies for more simpler unit tests.
Library which allows to seemlesly mock NSubstitute dependencies for more simpler unit tests.
A simple "auto-mocking" container that helps you test classes with multiple dependencies. The interface is inspired by darrencauthon/AutoMoq
Auto mocking of test method parameters with xUnit and Moq. Similar to Jukito for Java, see http://code.google.com/p/jukito. Check out the project site for some usage examples.
Mock Ioc Helpers. It helps instiantiation of classes through IOC and automock. Based on Moq and DryIOC. Provides MockUnitTestFixture WriterUnitTestFixture
For creating in-memory SQLite databases to be used within unit tests using AutoMocker.
Don't spend hours writing code to mock a dozen dependencies, and more hours debugging it. Just write your test code, and let FixtureBase create the dependencies for you. FixtureBase constructs your UnitUnderTest to test your codebase end-to-end, with external dependencies auto-faked and automatically injected in just the right place; even constructor dependencies that are several layers deep. You just write your tests: ``` public class FixtureBaseExample : FixtureBaseWithDbAndHttpFor<AUseCase> { [Fact] public void UUTSendsDataToDb() { var newDatum = new Datum{Id=99, Name="New!" }; UnitUnderTest.InsertDb(newDatum); Db.ShouldHaveInserted("Data",newDatum); } [Fact] public void UUTreturnsDataFromDbQuerySingleColumn() { var dbData = new[] { "row1", "row2", "row3", "row4"}; Db.SetUpForQuerySingleColumn(dbData); UnitUnderTest.FromDbStrings().ShouldEqualByValue(dbData); } [Fact] public async Task UUTGetHttpReturnsDataFromService() { var contentFromService = "IGotThis!"; HttpClient .Setup(m => true) .Returns(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent(contentFromService)}); (await UnitUnderTest.GetHttp()).ShouldBe(contentFromService); HttpClient.Verify(x=>x.Method==HttpMethod.Get); } } ``` The included examples demonstrate FixtureBases for applications which depend on Ado.Net IDbConnections and on HttpClient network connections. - To create your own FixtureBase with your own preferred Fakes, see the examples at <https://github.com/chrisfcarroll/ActivateAnything/blob/master/FixtureBase/FixtureExample.cs.md> - For how it's done, see <https://github.com/chrisfcarroll/ActivateAnything/blob/master/FixtureBase/FixtureBase.cs> Construction is done by - [ActivateAnything](https://www.nuget.org/packages/ActivateAnything) Faking is done by - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [TestBase.HttpClient.Fake](https://www.nuget.org/packages/TestBase.HttpClient.Fake) For more tools focussed on cutting the cost of unit testing, see also: - [TestBase](https://www.nuget.org/packages/TestBase) - [TestBase.AspNetCore.Mvc](https://www.nuget.org/packages/TestBase.AspNetCore.Mvc) - [TestBase-Mvc](https://www.nuget.org/packages/TestBase-Mvc) - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [TestBase.HttpClient.Fake](https://www.nuget.org/packages/TestBase.HttpClient.Fake) - [Serilog.Sinks.ListOfString](https://www.nuget.org/packages/Serilog.Sinks.Listofstring) - [Extensions.Logging.ListOfString](https://www.nuget.org/packages/Extensions.Logging.ListOfString)
A NuGet package for making HttpClients slightly easier to test.
Simple full-featured automocking framework
Common infrastructure for tests
Test base class using NSubstitute for NUnit tests that lets you skip all the boring setup
A simple "auto-mocking" container that helps you test classes with multiple dependencies. The interface is inspired by darrencauthon/AutoMoq. If you don't need to use it with existing Microsoft.DependencyInjection.IServiceCollection, then it's better to pick the plain AutoMoqSlim