当我在Visual Studio中创建新的单元测试时(使用默认的,包含的单元测试框架),我越来越讨厌使用不必要的冗长模板。取而代之的VS单元测试框架中的单元测试模板在哪里?
public ImportModelStateTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
我想有根本
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext { get; set; }
如果我需要一个构造函数,我将添加一个,同样也适用于特殊的getter和setter。我还想删除包含的示例TestMethod - 我仍然需要重命名它,所以我可以从头开始编写自己的。
我已经找了用于创建这些测试文件的模板,但没能找到它(我的用于控制器和视图的T4模板附近看了大多是围绕)。我在哪里改变这个模板?
我知道你的意思。我前段时间尝试过,发现测试代码是动态创建的。我最终的解决方案是去nUnit。 – Robert 2009-06-02 19:18:37