public void ShouldNotAcceptNullDice()
        {
            var fakePlayer = new Mock <ScoreBoard>();
            var sut        = new AllAvailableCategoriesStrategy();

            Assert.Throws <ArgumentNullException>(() => sut.GetCategories(null, fakePlayer.Object));
        }
        public void ShouldNotAcceptNullScoreBoard()
        {
            var fakeDice = new Mock <Dice>();
            var sut      = new AllAvailableCategoriesStrategy();

            Assert.Throws <ArgumentNullException>(() => sut.GetCategories(fakeDice.Object, null));
        }
        private List <Category> ExersciseSUTWithScoreBoard(List <int> diceValues, List <Category> occupied)
        {
            var fakePlayer = new Mock <ScoreBoard>();

            fakePlayer.Setup(p => p.GetOccupiedCategories()).Returns(occupied);

            var fakeDice = new Mock <Dice>();

            fakeDice.Setup(d => d.GetValues()).Returns(diceValues);

            var sut = new AllAvailableCategoriesStrategy();

            return(sut.GetCategories(fakeDice.Object, fakePlayer.Object));
        }
示例#4
0
        public void NewMainController()
        {
            var player = new Player();

            var category = new AllAvailableCategoriesStrategy();

            var die1 = new DieImplemented();
            var die2 = new DieImplemented();
            var die3 = new DieImplemented();
            var die4 = new DieImplemented();
            var die5 = new DieImplemented();
            var dice = new DiceImplemented(die1, die2, die3, die4, die5);

            var diceView   = new DiceView(dice);
            var view       = new EnglishMainView(diceView);
            var game       = new Game(category, dice);
            var controller = new MainController(view, player, game);

            Assert.IsType <MainController>(controller);
        }