private void ProcessTestDocument(string document, StoryTestWriter writer)
 {
     try {
         var storyTest = new StoryTest(service, writer)
                         .WithInput(document)
                         .OnAbandonSuite(() => { suiteIsAbandoned = true; });
         reporter.WriteLine(storyTest.Leader);
         if (suiteSetupIdentifier.IsStartOf(storyTest.Leader) || IMaybeProcessingSuiteSetup)
         {
             storyTest.Execute();
         }
         else
         {
             storyTest.Execute(new Service.Service(service));
         }
     }
     catch (Exception e) {
         var testStatus = new TestStatus();
         var parse      = new CellBase(parseError, "div");
         parse.SetAttribute(CellAttribute.Body, parseError);
         testStatus.MarkException(parse, e);
         writer.WriteTable(new CellTree(parse));
         writer.WriteTest(new CellTree().AddBranchValue(parse), testStatus.Counts);
     }
 }
Exemplo n.º 2
0
 private void ProcessTestDocument(string document, StoryTestWriter writer)
 {
     try
     {
         Tree <Cell> result    = service.Compose(new StoryTestString(document));
         var         parse     = result != null ? (Parse)result.Value : null;
         var         storyTest = new StoryTest(parse, writer);
         reporter.WriteLine(parse.Leader);
         if (suiteSetupIdentifier.IsStartOf(parse.Leader) || IMaybeProcessingSuiteSetup)
         {
             storyTest.ExecuteOnConfiguration(service.Configuration);
         }
         else
         {
             storyTest.Execute(service.Configuration);
         }
     }
     catch (Exception e)
     {
         var testStatus = new TestStatus();
         var parse      = new CellBase(parseError, "div");
         parse.SetAttribute(CellAttribute.Body, parseError);
         testStatus.MarkException(parse, e);
         writer.WriteTable(new CellTree(parse));
         writer.WriteTest(new CellTree().AddBranchValue(parse), testStatus.Counts);
     }
 }
Exemplo n.º 3
0
        private void ProcessTestDocument(string document, StoryTestWriter writer) {
			try {
			    var storyTest = new StoryTest(service, writer)
                    .WithInput(document)
                    .OnAbandonSuite(() => { suiteIsAbandoned = true; });
			    reporter.WriteLine(storyTest.Leader);
			    if (suiteSetupIdentifier.IsStartOf(storyTest.Leader) || IMaybeProcessingSuiteSetup)
                    storyTest.Execute();
                else
                    storyTest.Execute(new Service.Service(service));
			}
			catch (Exception e) {
			    var testStatus = new TestStatus();
			    var parse = new CellBase(parseError, "div");
                parse.SetAttribute(CellAttribute.Body, parseError );
			    testStatus.MarkException(parse, e);
                writer.WriteTable(new CellTree(parse));
			    writer.WriteTest(new CellTree().AddBranchValue(parse), testStatus.Counts); 
			}
		}
Exemplo n.º 4
0
 private void ProcessTestDocument(string document, StoryTestWriter writer)
 {
     try
     {
         Tree<Cell> result = service.Compose(new StoryTestString(document));
         var parse = result != null ? (Parse)result.Value : null;
         var storyTest = new StoryTest(parse, writer);
         reporter.WriteLine(parse.Leader);
         if (suiteSetupIdentifier.IsStartOf(parse.Leader) || IMaybeProcessingSuiteSetup)
             storyTest.ExecuteOnConfiguration(service.Configuration);
         else
             storyTest.Execute(service.Configuration);
     }
     catch (Exception e)
     {
         var testStatus = new TestStatus();
         var parse = new CellBase(parseError, "div");
         parse.SetAttribute(CellAttribute.Body, parseError );
         testStatus.MarkException(parse, e);
         writer.WriteTable(new CellTree(parse));
         writer.WriteTest(new CellTree().AddBranchValue(parse), testStatus.Counts);
     }
 }