@@ -72,9 +72,9 @@ Deviations
7272// 4 basic "dumb" Data types - Company now has a bank account
7373object ShoppingCartModel7 {
7474 case class Product (name : String , price : Int )
75- case class Person (name : String , var cash : Int , owns : mutable.Map [Int , Product ] = mutable.Map ())
76- case class Company (name : String , var bankAccount : Int , stock : mutable.Map [Int , Product ], goldMembers : mutable.Set [Person ])
77- case class Order (customer : Person , items : mutable.Map [Int , Product ] = mutable.Map ())
75+ case class User (name : String , var cash : Int , owns : mutable.Map [Int , Product ] = mutable.Map ())
76+ case class Company (name : String , var bankAccount : Int , stock : mutable.Map [Int , Product ], goldMembers : mutable.Set [User ])
77+ case class Order (customer : User , items : mutable.Map [Int , Product ] = mutable.Map ())
7878}
7979
8080// Setup for each test
@@ -83,15 +83,15 @@ trait ShoppingCart7setup extends Scope {
8383 val (p1, p2, p3) = (1 , 2 , 3 )
8484 val (wax, tires, bmw) = (p1 -> Product (" Wax" , 40 ), p2 -> Product (" Tires" , 600 ), p3 -> Product (" BMW" , 50000 ))
8585 val shop = Company (" Don's Auto shop" , 100000 , mutable.Map (wax, tires, bmw), mutable.Set ())
86- val customer = Person (" Matthew" , 20000 )
86+ val customer = User (" Matthew" , 20000 )
8787}
8888
8989class ShoppingCart7 extends Specification {
9090 import ShoppingCartModel7 ._
9191
9292 {
9393 @ context
94- class PlaceOrder (comp : Company , person : Person ) {
94+ class PlaceOrder (comp : Company , user : User ) {
9595
9696 // Trigger methods
9797 def processProductSelection (desiredProductId : Int ): Option [Product ] = {
@@ -116,9 +116,9 @@ class ShoppingCart7 extends Specification {
116116 // Roles (in order of "appearance")
117117 private val warehouse = comp
118118 private val company = comp
119- private val customer = person
120- private val cart = Order (person )
121- private val paymentGateway = comp
119+ private val customer = user
120+ private val cart = Order (user )
121+ private val paymentGateway = comp // would be played by something else in a real-world application...
122122 private val companyAccount = comp
123123
124124 role warehouse {
0 commit comments