public TestContextStep Establish(IFixtureContext context, TestContextStep next) { var pending = FirstPendingOrDefault(context.Attributes, FirstPendingOrDefault(context.Fixture.FixtureType.AsConeAttributeProvider(), null)); return (pending == null) ? Runnable(next) : Pending(next, pending.Reason); }
public TestContextStep Establish(IFixtureContext context, TestContextStep next) { return (test, r) => { before(test); test.Timed(_ => next(test, r), after); }; }
public TestContextStep Establish(IFixtureContext context, TestContextStep next) { return (test, result) => { try { if(Before(result)) next(test, result); } finally { After(result); } }; }
public IGrammar FindGrammar(IFixtureContext parent) { var innerGrammar = parent.RetrieveFixture(FixtureName)[GrammarKey]; if (CurryAction == null) { return(innerGrammar); } return(new CurriedLineGrammar(CurryAction.Template, (IGrammarWithCells)innerGrammar, CurryAction.DefaultValues)); }
public TestContextStep Establish(IFixtureContext context, TestContextStep next) { var fixture = context.Fixture; return (test, result) => { try { fixture.Before(); } catch(Exception ex) { result.BeforeFailure(ex); return; } next(test, result); }; }
public TestContextStep Establish(IFixtureContext context, TestContextStep next) { var fixture = context.Fixture; return (test, result) => { try { next(test, result); } finally { try { fixture.After(result); } catch (Exception ex) { result.AfterFailure(ex); } } }; }
public TestContextStep Establish(IFixtureContext context, TestContextStep next) { return next; }
Func<TestContextStep, ITestExecutionContext, TestContextStep> CombineEstablish(IFixtureContext context) { return (acc, x) => x.Establish(context, acc); }
public NewService(IFixtureContext context) : base(context) { }
/// <summary> /// Restores the UI culture that is one before running the fixture. /// </summary> /// <param name="context">The context of the fixture.</param> public override void OnFixtureRun(IFixtureContext context) { Thread.CurrentThread.CurrentUICulture = OriginalUICulture; CultureInfo.CurrentUICulture.ClearCachedData(); }
/// <summary> /// Stores the current culture and replaces it with the culture specified in the constructor. /// </summary> /// <param name="context">The context of the fixture.</param> public override void OnFixtureRunning(IFixtureContext context) { OriginalCulture = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = Culture; CultureInfo.CurrentCulture.ClearCachedData(); }
public void StartFixture(IFixtureContext context) { _loader.LoadFixture(context); }
public void LoadFixture(IFixtureContext context) { context.LoadFixture(_fixtureName, _section); }
/// <summary> /// Occurs after running the fixture. /// </summary> /// <param name="context">The context of the fixture</param> public virtual void OnFixtureRun(IFixtureContext context) { }
protected static void SetContext(IFixtureContext context) { _context = context; }
protected FixtureContextAware(IFixtureContext context) { _context = context; }