private static void AssertAppWasRun(string siteName, int app, string expectedText, string expectedWebConfig = null)
{
if (string.IsNullOrEmpty(expectedWebConfig))
expectedWebConfig = siteName == SiteName ? WebConfigContents : WebConfig2Contents;
var outputFile = Path.Combine(GetExecutionDropPath(siteName, app), "file.txt");
Assert.That(File.Exists(outputFile), outputFile + " didn't exist");
Assert.That(File.ReadAllText(outputFile), Is.EqualTo(expectedText), "Text in " + outputFile + " didn't match expectation");
var webConfigFile = Path.Combine(GetExecutionDropPath(siteName, app), "web.config");
Assert.That(File.Exists(webConfigFile), webConfigFile + " didn't exist");
Assert.That(File.ReadAllText(webConfigFile), Is.EqualTo(expectedWebConfig), "Text in " + webConfigFile + " didn't match expectation");
}