forked from darrencauthon/AutoMoq
-
Notifications
You must be signed in to change notification settings - Fork 0
grollinger/AutoMoq
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AutoMoqer is an "auto-mocking" container that automatically creates any fake objects that are necessary to instantiate the class under test. It's very similar to an IoC container in that it has a generic Resolve method that automatically fills in all dependencies, but unlike an IoC container it resolves the dependencies with mock objects. This can make your testing cleaner by allowing you to only write code for the mock objects that are relevant to your specific test. This tool uses Moq, my favorite .Net mocking framework, for all mocks. Example code: var mocker = new AutoMoqer(); mocker.GetMock<IDataDependency>() .Setup(x => x.GetData()) .Returns("TEST DATA"); var classToTest = mocker.Resolve<ClassToTest>(); classToTest.DoSomething(); mocker.GetMock<IDependencyToCheck>() .Setup(x=>x.CallMe("TEST"), Times.Once());
About
Auto mocking provider for Moq.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C# 92.1%
- Ruby 6.2%
- Classic ASP 1.5%
- Shell 0.2%