Ejemplo n.º 1
0
        private void CreateBadSwagCombinations(IWinner matchedWinner)
        {
            _badSwagCombinations.Add(matchedWinner);

            var duplicateSwag = _swag.Where(s => s.Company.ToLower() == matchedWinner.AwardedSwag.Company.ToLower() && s.Thing.ToLower() == matchedWinner.AwardedSwag.Thing.ToLower());

            foreach (var ds in duplicateSwag)
            {
                _badSwagCombinations.Add(Winner.Create(ds, matchedWinner.WinningAttendee));
            }
        }
Ejemplo n.º 2
0
        private IWinner GetWinner()
        {
            IAttendee winningAttendee = null;
            ISwag     swag            = null;

            var swagAwarded = false;

            while (!swagAwarded)
            {
                winningAttendee = GetAttendee();
                swag            = GetSwag();

                swagAwarded = IsAttendeeAndSwagComboValid(winningAttendee, swag);
            }

            var winner = Winner.Create(swag, winningAttendee);

            _winners.Add(winner);

            return(winner);
        }