Exemple #1
0
        public void TestDeployMultipleArguments()
        {
            using (var node = new NodeServer())
            {
                node.Bind(new IPEndPoint(IPAddress.Loopback, Constants.ConnectionPort));

                Deploy("DeployWithParameter.cs", new [] { IPAddress.Loopback.ToString() }, new[] { "42", "9001" }).Should().Be(9043);
            }
        }
Exemple #2
0
        public void TestDeployForwardArguments([Values(1, 2, 3, int.MaxValue)] int argument)
        {
            using (var node = new NodeServer())
            {
                node.Bind(new IPEndPoint(IPAddress.Loopback, Constants.ConnectionPort));

                Deploy("DeployWithParameter.cs", new [] { IPAddress.Loopback.ToString() }, new[] { argument.ToString() }).Should().Be(argument);
            }
        }
Exemple #3
0
        public void TestCopy1byte_a()
        {
            using (var node = new NodeServer())
            {
                node.Bind(new IPEndPoint(IPAddress.Loopback, Constants.ConnectionPort));

                Deploy("Copy1byte_a.cs", new [] { IPAddress.Loopback.ToString() }, new string[0]).Should().Be(0);
            }
        }
Exemple #4
0
        public void TestDeployWithDistributor()
        {
            using (var node = new NodeServer())
            {
                var ep = new IPEndPoint(IPAddress.Loopback, Constants.ConnectionPort);
                node.Bind(ep);

                // The script fails if no distributor is given
                Deploy("DeployWithDistributor.cs", new[] { ep.ToString() }, null).Should().Be((int)ExitCode.Success);
            }
        }
Exemple #5
0
        public void TestSetup()
        {
            var testDirectory = GetTestTempDirectory();

            if (Directory.Exists(testDirectory))
            {
                Directory.Delete(testDirectory, true);
            }

            _nodeServer  = new NodeServer();
            _distributor = new Distributor.Distributor(new ConsoleWriter(true));
            var ep = _nodeServer.Bind(IPAddress.Loopback);

            _nodeClient = _distributor.ConnectTo(ep);
        }
Exemple #6
0
        public void TestStartProcessWithoutTimeout()
        {
            using (var node = new NodeServer())
            {
                var ep = new IPEndPoint(IPAddress.Loopback, Constants.ConnectionPort);
                node.Bind(ep);

                var exitCode = ExitCode.Success;
                new Action(() =>
                {
                    exitCode = (ExitCode)Deploy("ExecuteDir.cs", new[] { ep.ToString() }, null);
                })
                .ExecutionTime().Should().BeLessOrEqualTo(TimeSpan.FromSeconds(10));
                exitCode.Should().Be(ExitCode.Success);
            }
        }