Ejemplo n.º 1
0
        public void GivenThePlayerHasAddedRandomEventsToTheBetslip(int numberOfEventsToAdd, string bettingType, string sportGame)
        {
            if (numberOfEventsToAdd <= 0)
            {
                Assert.Fail("Number of events to add must be greater than zero!");
            }
            if (string.IsNullOrEmpty(bettingType))
            {
                Assert.Fail("String bettingType is null or empty!");
            }
            if (string.IsNullOrEmpty(sportGame))
            {
                Assert.Fail("String sportGame is null or empty!");
            }

            try
            {
                if (bettingType.Equals(PREMATCH, StringComparison.OrdinalIgnoreCase))
                {
                    _navigationObject.NavigateToSportPage(bettingType);
                    _navigationObject.NavigateToSportGame(sportGame);
                }
                else if (bettingType.Equals(INPLAY, StringComparison.OrdinalIgnoreCase))
                {
                    _navigationObject.NavigateToSportPage(bettingType);
                    _navigationObject.NavigateToSportGame(sportGame);
                }
                else if (bettingType.Equals(SPECIAL, StringComparison.OrdinalIgnoreCase))
                {
                    _navigationObject.NavigateToSportPage(bettingType);
                }

                _sportBettingObject.AddRandomSportSelectionsToBetslip(numberOfEventsToAdd, bettingType);
            }
            catch (Exception e)
            {
                Assert.Fail($"Step 'the player has added {numberOfEventsToAdd} random {bettingType} {sportGame} events to the Betslip' failed! {e.Message}");
            }
        }