Skip to content

DennisNerush/VS-Test-Generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VS Test Generator

Download the extension at the .....


A Visual Studio extension for easily creating test class for the current working file.

See the changelog for updates and roadmap.

Features

  • Easily create test file for the current class
  • Map your source code projects to your Test projects via settings file
  • Set the current class as the target of the test
  • Add Nunit TestFixture attribute

Show the dialog

A new button is added to the context menu in Solution Explorer.

Add new file dialog

You can either click that button or use the keybord shortcut Shift+F2.

Settings

After you install the extension you need to map your source code projects to their matching test projects. The file is located at C:\Users{yourname}\AppData\Roaming\VS-Test-Generator.

// settings.json     
{
"SourceProjectName": {
    "path": "\\Path\\In\\TestProject",
    "name": "ProjectTestsName"
    }
}

Output

using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;

namespace TestNamespace
{
	[TestFixture]
    class YourClassTests : AbstractTestFixture
    {
		private YourClass _target;

		public YourClassTests() 
		{
			_target = new YourClass();
		}

		[Test]
		public void Method_When_Should()
		{
			//arrange

			//act

			//assert
		}
    }
}

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 2015 extension for Visual Studio which enables some features used by this project.

License

Apache 2.0

About

A Visual Studio extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%