summaryrefslogtreecommitdiff
path: root/src/main/java/au/id/zancanaro/javacheck/state/Command.java
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@zancanaro.id.au>2015-06-05 17:30:46 +1000
committerCarlo Zancanaro <carlo@zancanaro.id.au>2015-06-05 17:30:46 +1000
commit05ec409ce96da92d430c4a8e58b08d46f42d667a (patch)
tree2c3d8925fa9dd86cc265dcfbcb1fe5d8ee97cd0b /src/main/java/au/id/zancanaro/javacheck/state/Command.java
parent20b1226b4eb10e85497862bd73fe9e9a2f05191d (diff)
More work on the stateful checker; still not perfect, but it's getting better
Diffstat (limited to 'src/main/java/au/id/zancanaro/javacheck/state/Command.java')
-rw-r--r--src/main/java/au/id/zancanaro/javacheck/state/Command.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/au/id/zancanaro/javacheck/state/Command.java b/src/main/java/au/id/zancanaro/javacheck/state/Command.java
new file mode 100644
index 0000000..afa3957
--- /dev/null
+++ b/src/main/java/au/id/zancanaro/javacheck/state/Command.java
@@ -0,0 +1,23 @@
+package au.id.zancanaro.javacheck.state;
+
+import au.id.zancanaro.javacheck.Generator;
+
+public abstract class Command<State,Args,Result> {
+ public Generator<Args> argsGenerator(State state) {
+ return Generator.pure(null);
+ }
+
+ public boolean preCondition(State state, Args args) {
+ return true;
+ }
+
+ public abstract Result runCommand(Args args);
+
+ public State nextState(State state, Args args, CommandValue<Result> result) {
+ return state;
+ }
+
+ public boolean postCondition(State oldState, State newState, Args args, Result result) {
+ return true;
+ }
+}