When you right click on a method in a code file in Visual Studio 2008 you get this
which creates the unit test skeleton for that method.
Is there a way (by means of a template change or some nifty hack) by which I can change this to create unit tests based on Nunit rather than Visual Studio unit testing tools?
Something like this…
using System.Collections;
using NUnit.Framework;
namespace Domain.UnitTest
{
[TestFixture]
public class ManagerTest
{
[Test]
public void SomethingTest()
{
string expected = null;
string acutal = Something.Create();
Assert.AreEqual(expected, acutal);
}
Try modifying the file C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\1033\SimpleUnitTest.zip\SimpleUnitTest.cs
(after making a backup, of course). Keep a copy of your updated version elsewhere as this may get overwritten by updates.
FWIW -- I found this by searching for the string using Microsoft.VisualStudio.TestTools.UnitTesting;
inside files starting at the top level directory of the VS application directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With