예제 #1
0
        private void CantCalculateMarketProfitAndPayoutWithoutMarket()
        {
            var marketOutcome = MarketController.GetMarketCurrentOutcome(null);
            var success       = marketOutcome == null;

            Assert.True(success);
        }
예제 #2
0
        private void CantCalculateMarketProfitAndPayoutWithoutBets()
        {
            var newMarket = Common.CreateAndSaveMockMarket(Guid.NewGuid().ToString(), "Market 1",
                                                           0.5m, MarketController);
            var marketOutcome = MarketController.GetMarketCurrentOutcome(newMarket.Id);
            var success       = marketOutcome != null && marketOutcome.MarketLoseProfitAmount == 0 &&
                                marketOutcome.MarketWinPayoutAmount == 0;

            Assert.True(success);
        }
예제 #3
0
        private void CanCalculateMarketProfitAndPayout()
        {
            var nEvent = Common.CreateAndSaveMockEvent(EventController);

            var newMarket = Common.CreateAndSaveMockMarket(nEvent.Id, "Market 1",
                                                           0.5m, MarketController);

            Common.CreateAndSaveMockBet(newMarket.Id, 100, BetController);
            Common.CreateAndSaveMockBet(newMarket.Id, 50, BetController);
            Common.CreateAndSaveMockBet(newMarket.Id, 99.99m, BetController);

            MarketOutcome marketOutcome = MarketController.GetMarketCurrentOutcome(newMarket.Id);

            var success = (marketOutcome != null) &&
                          (marketOutcome.MarketLoseProfitAmount == 249.99m) &&
                          (marketOutcome.MarketWinPayoutAmount == 499.98m);

            Assert.True(success);
        }