Advertisement
Guest User

Untitled

a guest
Mar 24th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.17 KB | None | 0 0
  1.   it should "after selling shares, the order is deleted" in {
  2.     val asset = authorized { implicit auth =>
  3.       val asset = getAssets(auth.userId).head
  4.       createOffering(asset.id, 2, askPrice)
  5.       asset
  6.     }
  7.  
  8.     val asset2 = authorizedRandomUser { implicit auth =>
  9.       val asset2 = getAssets(auth.userId).head
  10.       val amount = 2
  11.       createTransaction(TransactionOperation.Deposit, askPrice * amount)
  12.       createOrder(asset.id, OrderType.Limit, OrderSide.Buy, askPrice, amount)
  13.       waitForUpdates()
  14.       createOrder(asset.id, OrderType.Limit, OrderSide.Sell, askPrice, amount)
  15.  
  16.       val userepoAccounts =  getUserInfo(auth.userId)
  17.       asset2
  18.  
  19.       authorizedRandomUser { implicit auth =>
  20.         val amount = 2
  21.         createTransaction(TransactionOperation.Deposit, askPrice * amount)
  22.         createOrder(asset2.id, OrderType.Limit, OrderSide.Buy, askPrice, amount)
  23.  
  24.         waitForUpdates()
  25.         val user =  getUserInfo(auth.userId)
  26.         user.cashAccounts.get.find(a => a.name == AccountName.Broker).get.bilan should be(0)
  27.       }
  28.       val user = getUserInfo(auth.userId)
  29.       user.depoAccounts should be (Some(List()))
  30.     }
  31.  
  32.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement