-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scalacheck for aggregates and projections #22
Conversation
1759c28
to
7645794
Compare
case object Decrement extends UnitCommand { | ||
def run(sut: Sut) = sut.synchronized { | ||
val action = sut.runner.db(agg, Counter.counterAggregate.handleCommand(Counter.Decrement)) | ||
sut.runner = sut.runner.run(action) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not particularly nice... I wonder if there is a better way?
|
||
property("fails when below zero") = CounterSpec.property() | ||
|
||
private object CounterSpec extends AggregateCommands[Counter.Event, Counter.flow.StateData, Int] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fristi hi!
what do you think about this kind of test for an aggregate? I'll create a similar one for the door agg.
projections, however, will need something more clever than this...
is there an alternative approach you can think of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response! Been busy lately with moving/new job 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem!
Congrats on a new job :)
@@ -0,0 +1,64 @@ | |||
import java.awt.print.Book |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Book? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops :) copy paste err.
I really like this direction! Especially the invariant property tests, great job! I have made some comments, see the diff |
Scalacheck for aggregates and projections
to cover #13