private static void AssertExceptionThrownOnRun(WindsorBootstrapper bootstrapper, Type expectedExceptionType, string expectedExceptionMessageSubstring, bool defaultConfig) { bool exceptionThrown = false; try { bootstrapper.Run(defaultConfig); } catch (Exception ex) { Assert.AreEqual(expectedExceptionType, ex.GetType()); StringAssert.Contains(ex.Message, expectedExceptionMessageSubstring); exceptionThrown = true; } if (!exceptionThrown) { Assert.Fail("Exception not thrown."); } }