public static HtmlDocument Build(Suite top, FixtureLibrary fixtures, string title) { var document = new HtmlDocument { Title = title }; document.Head.Append(BatchResultsWriter.StyleTag()); writeInitialData(document, top, fixtures, title); #if DEBUG var scriptTag = HomeEndpoint.ScriptTag(false, "/preview.js"); document.Body.Append(scriptTag); #else writeEnbeddedJavascript(document); #endif document.Body.Add("div").Id("main"); return(document); }
private SystemRecycled tryToStart() { CellHandling cellHandling = null; try { cellHandling = _system.Start(); } catch (Exception ex) { ConsoleWriter.Write(ConsoleColor.Red, ex.ToString()); var message = new SystemRecycled { success = false, fixtures = new FixtureModel[0], system_name = _system.ToString(), system_full_name = _system.GetType().FullName, name = Path.GetFileName(AppContext.BaseDirectory), error = ex.ToString() }; return(message); } var library = FixtureLibrary.CreateForAppDomain(cellHandling); startTheConsumingQueues(library); return(new SystemRecycled { success = true, fixtures = library.Models.GetAll().ToArray(), system_name = _system.ToString(), name = Path.GetFileName(AppContext.BaseDirectory) }); }
public void CreatePlan(FixtureLibrary library) { var culture = Project.CurrentProject?.Culture; if (culture.IsNotEmpty()) { #if NET46 Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); #else CultureInfo.CurrentCulture = new CultureInfo(culture); #endif } try { Plan = Specification.CreatePlan(library); } catch (Exception e) { Cancel(); EventAggregator.SendMessage(new PassthroughMessage(new RuntimeError(e))); } }
static TestingContext() { _library = new Lazy <FixtureLibrary>(() => { try { var fixture = new SentenceFixture(); var library = FixtureLibrary.CreateForAppDomain(new GrammarSystem().Start()); // Need to force it to use this one instead of the FactFixture in the samples project var factFixture = new StoryTeller.Testing.EndToEndExecution.FactFixture(); library.Models["Fact"] = factFixture.Compile(CellHandling.Basic()); library.Fixtures["Fact"] = factFixture; return(library); } catch (Exception e) { Console.WriteLine(e.ToString()); throw; } }); }
private IEnumerable <IExecutionStep> determineSteps(Step step, FixtureLibrary library) { var section = step.Collections[_leafName]; var sectionPlan = section.CreatePlan(library, _fixture); if (_before != null) { yield return(new SilentAction("Grammar", Stage.before, _before, section) { Subject = Key + ":Before" }); } yield return(sectionPlan); if (_after != null) { yield return(new SilentAction("Grammar", Stage.after, _after, section) { Subject = Key + ":After" }); } }
public void SetUp() { container = new Container(); view = new StubExplorerView(); shellConductor = MockRepository.GenerateMock <IScreenConductor>(); explorer = new FixtureExplorer(view, container); library = new FixtureLibrary(); FixtureGraph fixture1 = library.FixtureFor("Math"); fixture1.AddStructure("Grammar1", new Sentence()); fixture1.AddStructure("Grammar2", new Sentence()); fixture1.AddStructure("Grammar3", new Sentence()); FixtureGraph fixture2 = library.FixtureFor("Arithmetic"); fixture2.AddStructure("Grammar4", new Sentence()); fixture2.AddStructure("Grammar5", new Sentence()); explorer.Handle(new BinaryRecycleFinished(library)); }
public void SetUp() { baseLibrary = FixtureLibrary.For(x => x.AddFixturesFromAssemblyContaining <MathFixture>()); library = baseLibrary.Filter(f => f.Name == "Sentence" || f.Name == "Sets"); }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library, bool inTable = false) { return(new CompositeExecution(toExecutionSteps(library, step))); }
public void build_for_fixture_that_blows_up() { var compiled = FixtureLibrary.CreateCompiledFixture(CellHandling.Basic(), typeof(FixtureThatBlowsUp)); compiled.Model.implementation.ShouldBe(typeof(FixtureThatBlowsUp).FullName); }
public SpecRunner() { _system = new T(); _library = FixtureLibrary.CreateForAppDomain(_system.Start()); }
public void RecordSystemFixtures(SystemRecycled recycled) { _systemFixtures = FixtureLibrary.From(recycled.fixtures); }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library) { return(new CompositeExecution(determineSteps(step, library).ToArray())); }
public string ToPreview(FixtureLibrary library, Test test) { return(new HtmlWriter(library).WritePreview(test).ToString()); }
public BinaryRecycleFinished(FixtureLibrary library) { _library = library; }
public void Handle(BinaryRecycleFinished message) { _library = message.Library; }
public TestRunner(SystemLifecycle lifecycle, FixtureLibrary library, IFixtureContainerSource source) { _lifecycle = lifecycle; _library = library; _source = source; }
public TestRunner(ISystem system, FixtureLibrary library, IFixtureContainerSource source) : this(new SystemLifecycle(system), library, source) { }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library) { throw new NotImplementedException(); }
public IEnumerable <IStartupActionSelector> GetActionSelectors(FixtureLibrary library, WorkspaceFilter filter) { return(library.StartupActions.Select(x => new StartupActionSelector(x, filter.StartupActions.Contains(x))).ToArray()); }
public GrammarStructure ToStructure(FixtureLibrary library) { return(new DoGrammarStructure()); }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library, bool inTable = false) { var stepValues = _invocation.InputCells().ToStepValues(step); return(new FactCheckPlan(stepValues, this)); }
static TestingContext() { var fixture = new StoryTeller.Samples.Fixtures.SentenceFixture(); Library = FixtureLibrary.CreateForAppDomain(new GrammarSystem().Start()); }
IExecutionStep IGrammar.CreatePlan(Step step, FixtureLibrary library, bool inTable) { return new FactPlan(new StepValues(step.id), this); }
public void RecordSystemFixtures(FixtureLibrary system) { _systemFixtures = system; }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library, bool inTable = false) { var innerPlan = _inner.CreatePlan(step, library); return(new ImportedExecutionStep(_innerFixture, innerPlan)); }
public GrammarStructure ToStructure(FixtureLibrary library) { throw new NotImplementedException(); }
public HtmlWriter(FixtureLibrary library) { _library = library; }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library) { return(_inner.CreatePlan(step, library)); }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library, bool inTable = false) { return(_inner.CreatePlan(step, library)); }
public IExecutionStep CreatePlan(Step step, FixtureLibrary library, bool inTable = false) { _defaults.Each(pair => step.Values[pair.Key] = pair.Value); return(_inner.CreatePlan(step, library)); }