private void ValidateEngineStateCreation(EngineState previousState, EngineState newState, bool violation) { bool contractViolation = false; try { BuildXLEngineResult.Create(true, null, previousState, newState); } #pragma warning disable ERP022 // Unobserved exception in generic exception handler catch { contractViolation = true; } #pragma warning restore ERP022 // Unobserved exception in generic exception handler XAssert.AreEqual(violation, contractViolation); }
private void ValidateEngineStateCreation(bool success, EngineState previousState, EngineState newState, bool violation) { bool contractViolation = false; try { var result = BuildXLEngineResult.Create(true, null, previousState, newState, shouldDisposePreviousEngineState: false); result.DisposePreviousEngineStateIfRequestedAndVerifyEngineStateTransition(); } #pragma warning disable ERP022 // Unobserved exception in generic exception handler catch { contractViolation = true; } #pragma warning restore ERP022 // Unobserved exception in generic exception handler XAssert.AreEqual(violation, contractViolation); }