GithubHelp home page GithubHelp logo

autosetup's Introduction

Build Status Nuget Downloads

AutoSetup

AutoSetup is a code analyzer that automates instantiating mocks for a class under test (using Moq & XUnit).

While writing unit tests, instantiating mocks for a class under test is a time consuming task. AutoSetup saves you time by automatically detecting class under test, its dependencies and generating code to instantiate mocks.

Just install the nuget package in your test project and generate the code for instantiating mocks with click of a button.

AutoSetup can find class under test based on naming conventions (e.g for CalculatorTests the class name is expected to be Calculator). Class under test should be anywhere within the currently open solution in Visual Studio for AutoSetup to be able to find it.

Usage

  1. Install nuget package on your unit test project (Install-Package AutoSetup)
  2. In your unit test project create a new test class (e.g. CalculatorTests)
  3. Locate cursor on test class name
  4. Click "(Re-)generate Setup"

Steps

Please note:

  • Currently only supports XUnit and Moq.
  • Class under test is detected based on naming convention. For a test class with name "CalculatorTests", class under test is assumed to have the name "Calculator".
  • Locate the cursor on test class name to see "(Re-)Generate Setup" option.

Contributing

AutoSetup is a code analyzer/refactoring tool based on the .NET Compiler Platform (Roslyn). Please install .NET Compiler Platform SDK on your PC to be able to build and debug.

Please create a new branch from master and a Pull Request with your changes. Thanks.

License

This project is licensed under the Apache 2.0 License.

autosetup's People

Contributors

tukaya avatar tubafunda avatar

Stargazers

Tiago Rios avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.