public void TestIisExpressInvalidAttribute()
{
var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Environment.SetEnvironmentVariable("JEXUS_TEST_HOME", directoryName);
if (directoryName == null)
{
return;
}
string Current = Path.Combine(directoryName, @"applicationHost.config");
string Original = Path.Combine(directoryName, @"original2_invalid_attribute.config");
TestHelper.CopySiteConfig(directoryName, "original.config");
File.Copy(Original, Current, true);
TestHelper.FixPhysicalPathMono(Current);
#if IIS
var server = new ServerManager(Current);
#else
var server = new IisExpressServerManager(Current);
#endif
var exception = Assert.Throws <COMException>(
() =>
{
TestCases.TestIisExpress(server);
});
Assert.Equal(
string.Format(
"Filename: \\\\?\\{0}\r\nLine number: 143\r\nError: Unrecognized attribute 'testAuto'\r\n\r\n",
Current),
exception.Message);
}