Skip to content

Commit ad6d639

Browse files
authoredMar 4, 2018
Added script to test setRulesetEvalOp() method.
1 parent 4cdb1d7 commit ad6d639

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎test/testwonka.01.js

+13
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,18 @@ contract('WonkaEngine', function(accounts) {
147147
console.log("Current record for owner(" + accounts[0] + ") is valid? [" + recordValid + "]");
148148
});
149149
});
150+
it("change the eval operator from AND to OR for the RuleSet", function() {
151+
return WonkaEngine.deployed().then(function(instance) {
152+
instance.setRulesetEvalOp(accounts[0], false);
153+
console.log("Updated the eval op for the RuleSet from AND to OR!");
154+
});
155+
});
156+
it("run the business rules on the currently populated record", function() {
157+
return WonkaEngine.deployed().then(function(instance) {
158+
return instance.execute.call(accounts[0]);
159+
}).then(function(recordValid) {
160+
console.log("Current record for owner(" + accounts[0] + ") is valid? [" + recordValid + "]");
161+
});
162+
});
150163

151164
});

0 commit comments

Comments
 (0)
Please sign in to comment.