Exemple #1
0
 public void Run(CellProcessor processor, Tree <Cell> testTables, StoryTestWriter writer)
 {
     Assert.AreSame(parsedInput, testTables);
     parsedInput.Value.SetAttribute(CellAttribute.Body, result);
     writer.WriteTable(parsedInput);
     processor.TestStatus.MarkRight(testTables.Branches[0].Value);
 }
Exemple #2
0
 public TypedValue RunTest(Tree <Cell> testTables, StoryTestWriter writer)
 {
     Assert.AreSame(parsedInput, testTables);
     writer.WriteTable(parsedInput);
     Processor.TestStatus.MarkRight(testTables.Branches[0].Value);
     return(TypedValue.Void);
 }
 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);
     }
 }
Exemple #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);
     }
 }
Exemple #5
0
        public void ProcessTestDocuments(StoryTestWriter writer)
        {
            string document;

            while ((document = socket.ReceiveDocument()).Length > 0)
            {
                reporter.WriteLine("processing document of size: " + document.Length);
                ProcessTestDocument(document, writer);
                IMaybeProcessingSuiteSetup = false;
            }
            reporter.WriteLine("\ncompletion signal received");
        }
Exemple #6
0
        public void ProcessTestDocuments(StoryTestWriter writer)
        {
            string document;

            while ((document = socket.ReceiveDocument()).Length > 0)
            {
                reporter.WriteLine("processing document of size: " + document.Length);
                ProcessTestDocument(document, writer);
                IMaybeProcessingSuiteSetup = false;
            }
            reporter.WriteLine("\ncompletion signal recieved");
        }
Exemple #7
0
		public void ProcessTestDocuments(StoryTestWriter writer) {
			string document;

            while ((document = socket.ReceiveDocument()).Length > 0 && !suiteIsAbandoned) {
                reporter.WriteLine("processing document of size: " + document.Length);
                ProcessTestDocument(document, writer);
		        IMaybeProcessingSuiteSetup = false;
			}
		    reporter.WriteLine("\ncompletion signal received");
		    socket.Close();

            if (suiteIsAbandoned) throw new AbandonSuiteException();
		}
        public void ProcessTestDocuments(StoryTestWriter writer)
        {
            string document;

            while ((document = socket.ReceiveDocument()).Length > 0 && !suiteIsAbandoned)
            {
                reporter.WriteLine("processing document of size: " + document.Length);
                ProcessTestDocument(document, writer);
                IMaybeProcessingSuiteSetup = false;
            }
            reporter.WriteLine("\ncompletion signal received");
            socket.Close();

            if (suiteIsAbandoned)
            {
                throw new AbandonSuiteException();
            }
        }
Exemple #9
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); 
			}
		}
Exemple #10
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);
     }
 }
Exemple #11
0
 public StoryTest()
 {
     writer = new StoryTestNullWriter();
 }
Exemple #12
0
 public ExecuteStoryTest(CellProcessor processor, StoryTestWriter writer)
 {
     this.writer = writer;
     this.processor = processor;
 }
Exemple #13
0
 public void Run(CellProcessor processor, Tree <Cell> testTables, StoryTestWriter writer)
 {
     new ExecuteStoryTest(processor, writer).DoTables(testTables);
 }
Exemple #14
0
 public bool CanRunTest(Tree<Cell> testTables, StoryTestWriter writer)
 {
     return true;
 }
Exemple #15
0
 public TypedValue RunTest(Tree<Cell> testTables, StoryTestWriter writer)
 {
     new ExecuteStoryTest(Processor, writer).DoTables(testTables);
     return TypedValue.Void;
 }
Exemple #16
0
 public TypedValue RunTest(Tree <Cell> testTables, StoryTestWriter writer)
 {
     Assert.AreSame(parsedInput, testTables);
     writer.WriteTable(parsedInput);
     return(TypedValue.Void);
 }
 public TypedValue RunTest(Tree <Cell> testTables, StoryTestWriter writer)
 {
     new ExecuteStoryTest(Processor, writer).DoTables(testTables);
     return(TypedValue.Void);
 }
Exemple #18
0
 public bool CanRunTest(Tree <Cell> testTables, StoryTestWriter writer)
 {
     return(true);
 }
Exemple #19
0
 public StoryTest(Parse theTables, StoryTestWriter writer)
     : this(theTables)
 {
     this.writer = writer;
 }
Exemple #20
0
 public StoryTest()
 {
     writer = new StoryTestNullWriter();
 }
Exemple #21
0
 public StoryTest(Parse theTables, StoryTestWriter writer) : this(theTables) {
     this.writer = writer;
 }
Exemple #22
0
 public StoryTest(CellProcessor processor, StoryTestWriter writer)
 {
     this.processor = processor;
     this.writer    = writer;
 }