protected void ExpectFail(string errorType, string source, Func<InterpretationContext> func) { try { func(); Assert.Fail(source); } catch (BikeObject bo) { if (!ErrorFactory.IsErrorOfType(bo, errorType)) { Assert.Fail(source); } } }