Пример #1
0
        public void FindFullPath()
        {
            string actual   = RunNode.ResolvePath("HelloWorld.js");
            string expected = "./Assets/SimpleWebTransport/tests/node~/HelloWorld.js";

            Assert.That(Path.GetFullPath(actual), Is.EqualTo(Path.GetFullPath(expected)));
        }
Пример #2
0
        public void ShouldReturnHelloError()
        {
            RunNode.Result result = RunNode.Run("HelloError.js", false);

            result.AssetTimeout(false);
            result.AssetOutput();
            result.AssetErrors(
                "Hello Error!"
                );
        }
Пример #3
0
        public void ShouldReturnHelloWorld2()
        {
            RunNode.Result result = RunNode.Run("HelloWorld2.js", false);

            result.AssetTimeout(false);
            result.AssetOutput(
                "Hello World!",
                "Hello again World!"
                );
            result.AssetErrors();
        }
Пример #4
0
        public void ShouldStopAfterTimeout()
        {
            RunNode.Result result = RunNode.Run("Timeout.js", false);

            result.AssetTimeout(true);

            result.AssetTimeout(true);
            result.AssetOutput(
                "Should be running"
                );
            result.AssetErrors();
        }
Пример #5
0
        public void ShouldFinishBeforeTimeout()
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            RunNode.Result result = RunNode.Run("HelloWorld.js", false);

            stopwatch.Stop();
            double seconds = stopwatch.Elapsed.TotalSeconds;

            // hello script is fast and should finish faster than 1 second
            Assert.That(seconds, Is.LessThan(2.0));
        }