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.
- 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
A new button is added to the context menu in Solution Explorer.
You can either click that button or use the keybord shortcut Shift+F2.
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"
}
}
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
}
}
}
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.