예제 #1
0
 public void CantUpdateMissingBet()
 {
     Assert.Null(BetService.UpdateBet(new Bet()
     {
         Id = Guid.NewGuid().ToString()
     }));
 }
예제 #2
0
        public void CanUpdateExistingBet()
        {
            var mockEvent  = Common.CreateAndSaveMockEvent(EventController);
            var mockMarket = Common.CreateAndSaveMockMarket(mockEvent.Id, "Market Desc", 0.5m, MarketController);

            var createdBet = BetService.CreateBet(new Bet()
            {
                BetAmount = 123, MarketId = mockMarket.Id
            });

            createdBet.BetAmount = 234;
            BetService.UpdateBet(createdBet);

            Assert.Equal(234, BetService.GetById(createdBet.Id).BetAmount);
        }