All Projects → RandomEngy → UnitTestBoilerplateGenerator

RandomEngy / UnitTestBoilerplateGenerator

Licence: MIT license
An extension for Visual Studio that generates a unit test boilerplate from a given class, setting up mocks for all dependencies. Supports NUnit, Visual Studio Test, XUnit and many mock frameworks.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to UnitTestBoilerplateGenerator

Simplestubs
*SimpleStubs* is a simple mocking framework that supports Universal Windows Platform (UWP), .NET Core and .NET framework. SimpleStubs is currently developed and maintained by Microsoft BigPark Studios in Vancouver.
Stars: ✭ 66 (+69.23%)
Mutual labels:  unit-testing, roslyn
Enhanced Syntax Highlighting
[Marketplace] Lightweight "editor classifier extension" for Visual Studio based on the async Roslyn APIs to enhanced highlighting custom tags in C# code.
Stars: ✭ 69 (+76.92%)
Mutual labels:  roslyn, visual-studio-extension
Codist
A visual studio extension which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality and brings smart tool bar to code editor.
Stars: ✭ 134 (+243.59%)
Mutual labels:  roslyn, visual-studio-extension
experimental-tools
A bunch of quality refactorings and code fixes that are going to improve your C# development experience in Visual Studio and remove some common pain.
Stars: ✭ 19 (-51.28%)
Mutual labels:  roslyn, visual-studio-extension
ionic-workflow-guide
Create a full and powerful worflow with Ionic (Unit Testing, Environment variables, Automatic documentation, Production App Server, Automatic deployment)
Stars: ✭ 46 (+17.95%)
Mutual labels:  unit-testing
sbt-example
Run Scaladoc as unit tests
Stars: ✭ 30 (-23.08%)
Mutual labels:  unit-testing
jest-teamcity
Jest Teamcity Reporter
Stars: ✭ 29 (-25.64%)
Mutual labels:  unit-testing
ru.capralow.dt.unit
Запуск модульных тестов для EDT
Stars: ✭ 72 (+84.62%)
Mutual labels:  unit-testing
Uno.CodeGen
A set of source generators for equality, immutability, ...
Stars: ✭ 85 (+117.95%)
Mutual labels:  roslyn
DotNet.SystemCollections.Analyzers
A set of code analyzers & code fix providers to help developers use the proper .NET Collection & API in their algorithms
Stars: ✭ 72 (+84.62%)
Mutual labels:  roslyn
Faker.NET.Portable
C# port of the Ruby Faker gem (http://faker.rubyforge.org/)
Stars: ✭ 22 (-43.59%)
Mutual labels:  unit-testing
umock-c
A pure C mocking library
Stars: ✭ 29 (-25.64%)
Mutual labels:  unit-testing
SSD365VSAddIn
Visual studio addin for D365 Finance and operations
Stars: ✭ 21 (-46.15%)
Mutual labels:  visual-studio-extension
react-ssr-advanced-seed
🔮 React SSR Advanced Seed (Typescript + nestJS + React SSR + React Native + Docker)
Stars: ✭ 76 (+94.87%)
Mutual labels:  unit-testing
SqlInMemory
SqlInMemory is a library for creating SqlServer database on Memory instead of hard disk, at last Drops and Disposes database when you're done with it. This is useful for Integration Testing.
Stars: ✭ 24 (-38.46%)
Mutual labels:  unit-testing
vsc-material-theme-icons
Material Theme Icons, the most epic icons theme for Visual Studio Code and Material Theme.
Stars: ✭ 90 (+130.77%)
Mutual labels:  visual-studio-extension
get-bin-path
Get the current package's binary path
Stars: ✭ 25 (-35.9%)
Mutual labels:  unit-testing
markbot
An application that automatically tests and marks student code assignments in Algonquin College Graphic Design’s Web Dev courses.
Stars: ✭ 23 (-41.03%)
Mutual labels:  unit-testing
three-musketeers
A simple module to introspect, debug and test any THREE.js application.
Stars: ✭ 30 (-23.08%)
Mutual labels:  unit-testing
vs-material-icons-generator
This plugin will help you to set material design icons to your Xamarin projects In Visual Studio.
Stars: ✭ 50 (+28.21%)
Mutual labels:  visual-studio-extension

Unit Test Boilerplate Generator

Build status Visual Studio Marketplace Downloads Visual Studio Marketplace Rating Visual Studio Marketplace Version

Download this extension from the VS Marketplace or get the CI build.


Generates a unit test boilerplate from a given C# class, setting up mocks for all dependencies and test outlines for all public methods.

Test frameworks supported:

  • Visual Studio
  • NUnit
  • xUnit

Mock frameworks supported:

  • FakeItEasy
  • JustMock
  • Moq + AutoMoq
  • NSubstitute
  • Rhino Mocks
  • SimpleStubs

Dependency injection modes supported:

  • Constructor injection via any IoC framework
  • Property injection via Unity, Ninject or Grace

Right click an item in Solution Explorer and choose "Create Unit Test Boilerplate" .

Before Screenshot

This will create a test class in the same relative path as the class in a specified unit test project. All the dependencies are mocked and saved as fields which are created fresh for each test via [TestInitialize]. In addition, all public methods on the tested class are set up with a test method outline:

After Screenshot

Each mocking framework has its own pattern.

Other features

  • Customize the unit test output via templates: Go to Options > Unit Test Boilerplate Generator > Templates

Options Screenshot

Supported format tokens documentation

  • Supports mocking generic interfaces
  • Automatically brings in appropriate using statements
  • Applies any user-specific formatting rules to the generated code
  • Automatically detects which mocking library and test framework you're using

See the changelog for changes and roadmap. If you'd like to see support for other mocking frameworks or other IoC frameworks, open an issue.

Contribute

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools extension for Visual Studio which enables some features used by this project.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].