     @market.left_book.add_order.should.have.been.calledOnce
 
   it 'should close an order if there is a full match', ->
-    order1 = new Order(@bob, 'BTC', 1, 'USD', 10)
-    order2 = new Order(@sue, 'USD', 10, 'BTC', 1)
+    order1 = sellBTC(@bob, 1, 10)
+    order2 = buyBTC(@sue, 1, 10)
     
     @market.add_order(order1)
     results = @market.add_order(order2)

    closed.should.succeed_with('order_filled')

  it 'should open a partial order if demand remains after closing out other orders', ->
    #@market.add_order sellBTC(sue, 1, 15)
    @market.add_order sellBTC(jen, 1, 10)
    @market.add_order sellBTC(sue, 1, 10)
    @market.add_order sellBTC(jen, 1, 15)
    results = @market.add_order buyBTC(bob, 3, 30)

    results.should.have.length(4)

    closed = results.shift()
    closed.should.succeed_with('order_filled')
    closed = results.shift()
    closed.should.succeed_with('order_filled')
    opened = results.shift()
    opened.should.succeed_with('order_opened')
    partial = results.shift()
    partial.should.succeed_with('order_partially_filled')

  xit 'should do the right thing', ->
    bob = {name: 'bob'}
    sue = {name: 'sue'}
    jen = {name: 'jen'}

    ###console.log "\n*** Even matching"
    console.log "bob -> buy 1 BTC @ 10 USD"
    logResults @market.add_order(buyBTC(bob, 1, 10))
    console.log "sue -> buy 1 BTC @ 9 USD"
    logResults @market.add_order(buyBTC(sue, 1, 9))
    console.log "sue -> sell 1 BTC @ 10 USD"
    logResults @market.add_order(sellBTC(sue, 1, 10))
    console.log "bob -> sell 1 BTC @ 9 USD"
    logResults @market.add_order(sellBTC(bob, 1, 9))


    console.log "\n*** Progressive closing"
    console.log "bob -> sell 2 BTC @ 11 USD"
    logResults @market.add_order(sellBTC(bob, 2, 22))
    console.log "sue -> buy 1 BTC @ 11 USD"
    logResults @market.add_order(buyBTC(sue, 1, 11))
    console.log "sue -> buy 1 BTC @ 11 USD"
    logResults @market.add_order(buyBTC(sue, 1, 11))

    console.log "\n*** Multiple closing"
    console.log "jen -> sell 1 BTC @ 10 USD"
    logResults @market.add_order(sellBTC(jen, 1, 10))
    console.log "bob -> sell 1 BTC @ 10 USD"
    logResults @market.add_order(sellBTC(bob, 1, 10))
    console.log "sue -> sell 2 BTC @ 10 USD"
    logResults @market.add_order(buyBTC(sue, 2, 20))
    ###

    console.log "\n*** Overlapped Unequal Orders"
    console.log "bob -> sell 2 BTC @ 11 USD"
    logResults @market.add_order(sellBTC(bob, 2, 22))
    console.log "sue -> buy 1 BTC @ 11 USD"
    logResults @market.add_order(buyBTC(sue, 1, 11))
    console.log "sue -> buy 1 BTC @ 12 USD"
    logResults @market.add_order(buyBTC(sue, 1, 12))


    @market.right_book.add_order = sinon.spy()
    @market.left_book.add_order = sinon.spy()

    order1 = sellBTC(@bob, 1, 10)
    order2 = buyBTC(@sue, 1, 10)

    @market.add_order(order1)
    @market.right_book.add_order.should.have.been.calledOnce
