Example #1
0
 static string ProcessRequest(string request, Memory memory) {
     if (request == exitRequest) return exitReply;
     var service = new Service.Service(memory);
     var writer = new StoryTestStringWriter(service);
     var storyTest = new StoryTest(service, writer).WithInput("test@\n" + request);
     storyTest.Execute();
     return writer.Tables;
 }
Example #2
0
 public Parse PlainTest(string plainTest) {
     var writer = new StoryTestStringWriter(Processor);
     var storyTest = new StoryTest(Processor, writer)
         .WithInput("test@\n" + plainTest);
     storyTest.Execute(new Service.Service(Processor));
     var resultString = writer.Tables.Substring(11);
     var parseResult = Processor.Compose(new StoryTestString(resultString));
     return (Parse)parseResult.Branches[0];
 }
Example #3
0
        public void String(string storyTestText)
        {
            var writer    = new StoryTestStringWriter(processor);
            var storyTest = new StoryTest(processor, writer).WithInput(storyTestText);

            if (storyTest.IsExecutable)
            {
                storyTest.Execute();
                Result = writer.Tables;
            }
            else
            {
                Result = storyTestText;
            }
        }
Example #4
0
	    public void Run(IList<string> CommandLineArguments)
		{
			ParseCommandLineArguments(CommandLineArguments);

	        reporter = MakeReporter();

			clientSocket = new FitSocket(new SocketModelImpl(host, port), reporter);
			EstablishConnection();

	        var service = new Service(memory);
	        var writer = new StoryTestStringWriter(service)
	            .ForTables(WriteTables)
	            .ForCounts(WriteCounts);

		    var server = new SocketServer(clientSocket, service, reporter, true);
			server.ProcessTestDocuments(writer);

		    Exit();
		}
Example #5
0
 public string Run(string input) {
     var storyTestText =
         "<style type=\"text/css\">\n" +
         ".pass {background-color: #AAFFAA;}\n" +
         ".fail {background-color: #FFAAAA;}\n" +
         ".error {background-color: #FFFFAA;}\n" +
         ".ignore {background-color: #CCCCCC;}\n" +
         ".fit_stacktrace {font-size: 0.7em;}\n" +
         ".fit_label {font-style: italic; color: #C08080;}\n" +
         ".fit_grey {color: #808080;}\n" +
         ".fit_extension {border: solid 1px grey;}\n" +
         ".fit_table {border: solid 1px grey; border-collapse: collapse; margin: 2px 0px;}\n" +
         "table.fit_table tr td {border: solid 1px grey; padding: 2px 2px 2px 2px;}\n" +
         "</style>\n" +
         "test@\n" +
         input;
     service = new Service(memory);
     var writer = new StoryTestStringWriter(service);
     var storyTest = new StoryTest(service, writer).WithInput(storyTestText);
     storyTest.Execute();
     return writer.Tables;
 }