Implement scripting manager end-2-end

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-11-28 09:51:00 -08:00
parent 2da2969a36
commit 5e26384cae
2 changed files with 44 additions and 8 deletions

View File

@@ -7,10 +7,25 @@ using Orchard.Widgets.SimpleScripting;
namespace Orchard.Tests.Modules.SimpleScripting {
[TestFixture]
public class SimpleScriptingTests {
[Test]
public void EngineThrowsSyntaxErrors() {
var engine = new ScriptingEngine(Enumerable.Empty<IRuleProvider>(), new StubCacheManager());
Assert.That(() => engine.Matches("true+"), Throws.Exception);
}
[Test]
public void EngineThrowsEvalErrors() {
var engine = new ScriptingEngine(Enumerable.Empty<IRuleProvider>(), new StubCacheManager());
Assert.That(() => engine.Matches("1 + 1"), Throws.Exception);
}
[Test]
public void EngineUnderstandsPrimitiveValues() {
//var engine = new ScriptingEngine(Enumerable.Empty<IRuleProvider>(), new StubCacheManager());
//Assert.That(engine.Matches("true"), Is.True);
var engine = new ScriptingEngine(Enumerable.Empty<IRuleProvider>(), new StubCacheManager());
Assert.That(engine.Matches("true"), Is.True);
}
[Test]
public void EngineUnderstandsPrimitiveValues2() {
var engine = new ScriptingEngine(Enumerable.Empty<IRuleProvider>(), new StubCacheManager());
Assert.That(engine.Matches("true and true"), Is.True);
}
}
}