-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.5.0 - major refactorings and added DCI specifications
Also changed group id to "org.scaladci" at Sonatype repositories
- Loading branch information
Showing
17 changed files
with
1,009 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package scaladci | ||
package semantics | ||
import util._ | ||
|
||
class Interactions extends DCIspecification { | ||
|
||
// Interactions ... | ||
|
||
"Are preferably distributed between Roles" >> { | ||
|
||
@context | ||
case class Context(a: Data) { | ||
val b = a | ||
val c = a | ||
|
||
def distributedInteractions = a.foo | ||
|
||
role a { | ||
def foo = 2 * b.bar | ||
} | ||
|
||
role b { | ||
def bar = 3 * c.baz | ||
} | ||
|
||
role c { | ||
def baz = 4 * self.i | ||
} | ||
} | ||
Context(Data(5)).distributedInteractions === 2 * 3 * 4 * 5 | ||
} | ||
|
||
|
||
"Can occasionally be centralized in Context" >> { | ||
|
||
@context | ||
case class Context(a: Data) { | ||
val b = a | ||
val c = a | ||
|
||
def centralizedInteractions = a.foo * b.bar * c.baz * c.number | ||
|
||
role a { | ||
def foo = 2 | ||
} | ||
|
||
role b { | ||
def bar = 3 | ||
} | ||
|
||
role c { | ||
def baz = 4 | ||
} | ||
} | ||
Context(Data(5)).centralizedInteractions === 2 * 3 * 4 * 5 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.