public void Validate_extension_and_execute_expression() {
            // validate the script first
            ScriptManifestValidator validator = new ScriptManifestValidator();
            string scriptPath = Environment.CurrentDirectory + @"\ScriptTests\ExtensionTests.xml";
            ScriptManifestValidationResult result = validator.Validate(scriptPath);
            Assert.IsFalse(result.IsInvalid);

            // now execute a function against it
            ScriptTestHarness harness = new ScriptTestHarness();
            harness.LoadExtension(scriptPath);
            string executionResult = harness.Execute("test.Hello()");
            Assert.AreEqual(@"""hi""", executionResult);
        }
Beispiel #2
0
        public void Validate_extension_and_execute_expression()
        {
            // validate the script first
            ScriptManifestValidator validator = new ScriptManifestValidator();
            string scriptPath = Environment.CurrentDirectory + @"\ScriptTests\ExtensionTests.xml";
            ScriptManifestValidationResult result = validator.Validate(scriptPath);

            Assert.IsFalse(result.IsInvalid);

            // now execute a function against it
            ScriptTestHarness harness = new ScriptTestHarness();

            harness.LoadExtension(scriptPath);
            string executionResult = harness.Execute("test.Hello()");

            Assert.AreEqual(@"""hi""", executionResult);
        }