Example #1
0
        public void Choose_Valid_Move()
        {
            var move = new Paper();

            PlayerTestFactory.Create("Player 1",
                                     CallbackActionsTestFactory.Create(() => move))
            .DoMove()
            .Should().Be(move);
        }
Example #2
0
        public void Call_Choose_Move()
        {
            var executed = false;

            PlayerTestFactory.Create("Player 1",
                                     CallbackActionsTestFactory.Create(() =>
            {
                executed = true;
                return(new Paper());
            })).DoMove();
            executed.Should().BeTrue();
        }
 public static Player Create(string name) =>
 new Player(name, CallbackActionsTestFactory.Create(() => new Paper()));
Example #4
0
        public void Name_Not_Allow_Null(string name)
        {
            Action act = () => new Player(name, CallbackActionsTestFactory.Create());

            act.Should().Throw <ArgumentException>();
        }