Taketrung / betting-ai

Automatically exported from code.google.com/p/betting-ai
1 stars 1 forks source link

Market.cancelBets fails for the same bet on two different runners #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This junit test fails, because wrong bet on wrong runner is cancelled.

@Test def testCancelUnmatchedLayBetIsCancelledTheSameBetOnOtherRunnerExists{
        val market = new Market(1,"Match Odds","Man Utd vs Arsenal",1,new Date(2000),List(new Market.Runner(11,"Man Utd"),new Market.Runner(12,"Arsenal"))) 
        market.placeBet(100,123,10,1.95,LAY,11)
        market.placeBet(101,123,10,1.95,LAY,12)

        assertEquals(2,market.getBets(123).size)
        assertEquals(10,market.cancelBets(123,10,1.95,LAY,11),0)
        assertEquals(1,market.getBets(123).size)
        assertEquals(0,market.getBets(123).filter(b => b.runnerId==11).size)
        assertEquals

Original issue reported on code.google.com by daniel.k...@gmail.com on 26 Jul 2010 at 12:08

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 28 Jul 2010 at 4:49