Example #1
0
        public void ExecuteRawJavaScript_NullOrEmptyScript_ThrowsArgumentNullException(
            [Values(null, "")] string script)
        {
            Action action = () => Taconite.Execute(script);

            action.ShouldThrow <ArgumentNullException>();
        }
Example #2
0
        public void ExecuteJavaScriptResult()
        {
            var javaScriptResult = new JavaScriptResult();

            var result = Taconite.Execute(javaScriptResult);

            result.Commands.Should().HaveCount(1);
            var command = result.Commands.Single();

            command.As <EvalCommand>()
            .Should().NotBeNull()
            .ShouldHave().SharedProperties().EqualTo(new
            {
                Script           = (string)null,
                JavaScriptResult = javaScriptResult
            });
        }
Example #3
0
        public void ExecuteRawJavaScript()
        {
            var script = "console.log('hi');";

            var result = Taconite.Execute(script);

            result.Commands.Should().HaveCount(1);
            var command = result.Commands.Single();

            command.As <EvalCommand>()
            .Should().NotBeNull()
            .ShouldHave().SharedProperties().EqualTo(new
            {
                Script           = script,
                JavaScriptResult = (JavaScriptResult)null
            });
        }
Example #4
0
 public TaconiteResult ExecuteJavaScript()
 {
     return(Taconite.Execute("alert('Hello!');"));
 }
Example #5
0
        public void ExecuteJavaScriptResult_NullJavaScriptResult_ThrowsArgumentNullException()
        {
            Action action = () => Taconite.Execute((JavaScriptResult)null);

            action.ShouldThrow <ArgumentNullException>();
        }