Why Not Use Nant and Build Automation?
Ideally, Nant scripts and automated builds are much better solution then using the Pre/Post Build options. But if you are working on a small project and don’t want to deal with writing Nant scripts then you will find this solution to be useful. Project Structure: The project structure is fairly simple. We have three projects added to a single solution. Here is the list of the projects: 1) MyClassLibrary: Contains the domain objects 2) PrePostBuildEvents: Console application 3) TestSuite: Contains tests for the domain objects Project Implementation: The class library project “MyClassLibrary” contains a single domain object called “Calculator”. Here is the implementation of the Calculator object: public class Calculator { public double Add(double a, double b) { return (a + b); } } The TestSuite project contains the following test: [Test] public void should_be_able_to_add_two_numbers() { Calculator c = new Calculator(); Assert.AreEqual(10, c.Add(5, 5)); } So, everything is pretty simple!