Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Startup and Cleanup script for Visual Studio Test Project?

Tags:

I'm using a Visual Studio Test project, am modifying the test config with deployment files, etc. (through the VS GUI) and now I need to write a Startup script for the test run.

I have no clue what language or file type or mechanism is used for these scripts. Need a tip.

like image 319
John K Avatar asked Feb 21 '10 02:02

John K


1 Answers

Create a unit test in your test project. In the unit test class, create methods with the [TestInitialize] and [TestCleanup] attributes. They will be run before/after each test method.

Or, if you want to run before/after all test in that class, create static methods with [ClassInitialize] and [ClassCleanup] attributes.

Lastly, to run before/after all tests in the assembly, create static methods with [AssemblyInitialize] and [AssemblyCleanup] attributes.

like image 143
spoulson Avatar answered Oct 27 '22 02:10

spoulson