Example #1
0
        /// <inheritdoc />
        public IWager <IResultSet> AddExpectedResults(IResultSet expectedResults, decimal stakeValue)
        {
            if (expectedResults == null)
            {
                throw new ArgumentNullException(nameof(expectedResults));
            }

            if (!PossibleResults.Contains(expectedResults))
            {
                throw new ArgumentException(
                          "Specified value has to be one of the possible results.",
                          nameof(expectedResults));
            }

            if (stakeValue <= 0)
            {
                throw new ArgumentException(
                          "Specified value cannot be less than or equal to zero.",
                          nameof(stakeValue));
            }

            var stake = new Stake(stakeValue);
            var wager = new Wager <IResultSet>(this, expectedResults, stake);

            _multipleChoicePool.AddWager(wager);

            return(wager);
        }
Example #2
0
        /// <inheritdoc />
        public IWager <IResult> AddExpectedResults(IResult expectedResults, decimal stakeValue)
        {
            var multipleChoiceWager = _multipleChoiceBet.AddExpectedResults(
                new ResultSet(new[] { expectedResults }),
                stakeValue);
            var wager = new Wager <IResult>(
                this,
                multipleChoiceWager.ExpectedResults.Results.Single(),
                multipleChoiceWager.Stake);

            _wagers[wager] = multipleChoiceWager;
            return(wager);
        }