Usually you have to test a lot of thinks in the production area. In the development area or staging area you can use some tricks like debugging or something similar. But the production is the evil environment, when all the things that worked, now don’t work anymore. I have developed a little pattern to create a test page visible on to the producion area:
delegate bool ExecuteTestHandler();
protected string TestString;protected void Page_Load(object sender, EventArgs e)
{
string description = “test log writing – 01″;
ExecuteTest(description, TestLog);
}void ExecuteTest(string desc, ExecuteTestHandler method)
{
TestString += desc + “<br />”;
bool result = method();
TestString += (result ? “<font color=’green’>OK</font>” : “<font color=’red’>FAILED</font>”) + “<br />”;
}#region . testing methods
bool TestLog()
{
return true;
}#endregion
In this way you can insert and create your methods to test some critical features like db, log, mail sending, etc..