MarkException() public method

public MarkException ( Cell cell, System exception ) : void
cell Cell
exception System
return void
Exemplo n.º 1
0
 public bool FinalCheck(TestStatus testStatus) {
     if (myColumnsUsed == null) return true;
     for (int column = 0; column < myHeaderRow.Branches.Count; column++) {
         if (myColumnsUsed[column]) continue;
         testStatus.MarkException(myHeaderRow.Branches[column].Value,
                                  new FitFailureException(String.Format("Column '{0}' not used.", myHeaderRow.Branches[column].Value.Text)));
         return false;
     }
     return true;
 }
Exemplo n.º 2
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.º 3
0
 private void ProcessTestDocument(string document, Action<string, TestCounts> writer)
 {
     try
     {
         Tree<Cell> result = service.Compose(new StoryTestString(document));
         var parse = result != null ? (Parse)result.Value : null;
         var storyTest = new StoryTest(parse, (tables, counts) => WriteResults(tables, counts, 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 Parse("div", "Unable to parse input. Input ignored.", null, null);
         testStatus.MarkException(parse, e);
         WriteResults(parse, testStatus.Counts, writer);
     }
 }
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);
     }
 }
Exemplo n.º 5
0
 public bool FinalCheck(TestStatus testStatus)
 {
     if (myColumnsUsed == null) return true;
     for (int column = 0; column < myHeaderRow.Parts.Size; column++) {
         if (!myColumnsUsed[column]) {
             testStatus.MarkException(myHeaderRow.Parts.At(column),
                 new FitFailureException(String.Format("Column '{0}' not used.", myHeaderRow.Parts.At(column).Text)));
             return false;
         }
     }
     return true;
 }