Yes, you can, on several levels:
Project Template
You can get rid of the "About Test Projects" and other files using the Options menu in Visual Studio.
Go to Test Tools -> Test Project and unselect the options you don't want.
If that is not enough, you can find the project template in a folder similar to this:
C:Program Files (x86)Microsoft Visual Studio 9.0Common7IDEProjectTemplatesCSharpTest1033
Your path may differ slightly if you run on 32-bit Windows or have a different culture, but you should be able to find it.
Unit Test File Template
In vanilla Visual Studio, the templates for the unit test can be found in a folder similar to this (from my machine):
C:Program Files (x86)Microsoft Visual Studio 9.0Common7IDEItemTemplatesCSharp1033
In this folder there is a file called SimpleUnitTest.zip that contains two files:
- SimpleUnitTest.cs
- SimpleUnitTest.vstemplate
You can edit the SimpleUnitTest.cs file to remove all the code you don't want to have, but you must remember to re-zip the file so that it contains your changes.
However, if you only do that, VS may not pick up your changes anytime soon, since it maintains an unzipped cache of templates in
C:Program Files (x86)Microsoft Visual Studio 9.0Common7IDEItemTemplatesCacheCSharp1033
So you will need to edit the file there as well (or simply copy your changed file there).
As far as I have been able to tell, VS normally uses the templates in ItemTemplateCache, but occasionally reinstates them from ItemTemplates. This seems to happen when updates are applied, but I have yet to identify a consistent pattern, so simply updating in both places is the best way to modify the templates that I have been able to come up with.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…