Example #1
0
        /// <summary>
        ///     Simple constructor. No arguments may be null.
        /// </summary>
        /// <param name="CardFactory">Responsible for creating new Card objects.</param>
        /// <param name="PokerHandFactory">Responsible for creating new PokerHand objects.</param>
        /// <param name="PokerHandJudge">
        ///     Used by the controller to evaluate poker hands provided to it.
        /// </param>
        /// <param name="ViewModelFactory">Creates new view models for containing evaluation data.</param>
        public PokerDemoController(
            Func <Card> CardFactory,
            Func <PokerHand> PokerHandFactory,
            PokerHandJudge PokerHandJudge,
            Func <PokerEvaluationViewModel> ViewModelFactory)
        {
            if (CardFactory == null)
            {
                throw new ArgumentNullException("CardFactory");
            }
            if (PokerHandFactory == null)
            {
                throw new ArgumentNullException("PokerHandFactory");
            }
            if (PokerHandJudge == null)
            {
                throw new ArgumentNullException("PokerHandJudge");
            }
            if (ViewModelFactory == null)
            {
                throw new ArgumentNullException("ViewModelFactory");
            }

            cardFactory      = CardFactory;
            pokerHandFactory = PokerHandFactory;
            pokerHandJudge   = PokerHandJudge;
            viewModelFactory = ViewModelFactory;
        }
        /// <summary>
        ///     Simple constructor. No arguments may be null.
        /// </summary>
        /// <param name="CardFactory">Responsible for creating new Card objects.</param>
        /// <param name="PokerHandFactory">Responsible for creating new PokerHand objects.</param>
        /// <param name="PokerHandJudge">
        ///     Used by the controller to evaluate poker hands provided to it.
        /// </param>
        /// <param name="ViewModelFactory">Creates new view models for containing evaluation data.</param>
        public PokerDemoController(
            Func<Card> CardFactory,
            Func<PokerHand> PokerHandFactory,
            PokerHandJudge PokerHandJudge,
            Func<PokerEvaluationViewModel> ViewModelFactory)
        {
            if (CardFactory == null) throw new ArgumentNullException("CardFactory");
            if (PokerHandFactory == null) throw new ArgumentNullException("PokerHandFactory");
            if (PokerHandJudge == null) throw new ArgumentNullException("PokerHandJudge");
            if (ViewModelFactory == null) throw new ArgumentNullException("ViewModelFactory");

            cardFactory = CardFactory;
            pokerHandFactory = PokerHandFactory;
            pokerHandJudge = PokerHandJudge;
            viewModelFactory = ViewModelFactory;
        }
 public void Setup()
 {
     testJudge = new PokerHandJudge(
         () => { return new PokerHandVerdict(); });
 }
 public void NullVerdictFactoryTest()
 {
     testJudge = new PokerHandJudge(null);
 }
Example #5
0
 public void NullVerdictFactoryTest()
 {
     testJudge = new PokerHandJudge(null);
 }
Example #6
0
 public void Setup()
 {
     testJudge = new PokerHandJudge(
         () => { return(new PokerHandVerdict()); });
 }