Ejemplo n.º 1
0
 private void RunTest(CellProcessor service, string tables) {
     var socket = new TestSocket();
     socket.PutByteString(Protocol.FormatInteger(tables.Length));
     socket.PutByteString(tables);
     socket.PutByteString(Protocol.FormatInteger(0));
     var server = new SocketServer(new FitSocket(socket, new NullReporter()), service, new NullReporter(), false);
     server.ProcessTestDocuments(new StoryTestStringWriter(service).ForTables(s => resultTables += s));
     Assert.IsFalse(socket.isOpen);
 }
Ejemplo n.º 2
0
 public void ParseExceptionIsRecorded()
 {
     var service = new Service.Service();
     const string tables = "<table>garbage</table>";
     var socket = new TestSocket();
     socket.PutByteString("0000000022");
     socket.PutByteString(tables);
     socket.PutByteString("0000000000");
     var server = new SocketServer(new FitSocket(socket, new NullReporter()), service, new NullReporter(), false);
     server.ProcessTestDocuments(new StoryTestStringWriter(service).ForTables(s => resultTables += s));
     Assert.IsTrue(resultTables.Contains("class=\"error\""), resultTables);
     Assert.IsTrue(resultTables.Contains("Unable to parse input. Input ignored."), resultTables);
 }
Ejemplo n.º 3
0
 public void StoryTestIsExecuted()
 {
     var service = new Service.Service();
     service.AddNamespace("fitlibrary");
     service.ApplicationUnderTest.AddAssembly("fit.dll");
     const string tables = "<table><tr><td>do</td></tr></table><table><tr><td>do</td></tr></table>";
     var socket = new TestSocket();
     socket.PutByteString("0000000070");
     socket.PutByteString(tables);
     socket.PutByteString("0000000000");
     var server = new SocketServer(new FitSocket(socket, new NullReporter()), service, new NullReporter(), false);
     server.ProcessTestDocuments(new StoryTestStringWriter(service).ForTables(s => resultTables += s));
     Assert.AreEqual(tables, resultTables);
 }
Ejemplo n.º 4
0
        public void Run(string[] CommandLineArguments)
        {
            ParseCommandLineArguments(CommandLineArguments);

            reporter = MakeReporter();

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

            var server = new SocketServer(clientSocket, configuration.GetItem<Service>(), reporter, true);
            server.ProcessTestDocuments(WriteResults);

            clientSocket.Close();
            Exit();
        }
Ejemplo n.º 5
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();
		}
Ejemplo n.º 6
0
 public int Run(string[] commandLineArguments, Configuration configuration, ProgressReporter reporter)
 {
     this.configuration = configuration;
     if(!ParseArgs(configuration, commandLineArguments))
     {
         PrintUsage();
         return ExitCode();
     }
     clientSocket = new FitSocket(new SocketModelImpl(host, port), MakeReporter());
     server = new SocketServer(clientSocket, new Service(configuration), MakeReporter(), false);
     clientSocket.EstablishConnection(Protocol.FormatRequest(pageName, usingDownloadedPaths, suiteFilter));
     AddAssemblies();
     server.ProcessTestDocuments(WriteTestRunner);
     HandleFinalCount(totalCounts);
     clientSocket.Close();
     Exit();
     resultWriter.Close();
     return ExitCode();
 }