Exemple #1
0
        public void ExecuteShouldThrowArgumentNullExceptionWhenParametersIsNull()
        {
            var factoryStub = new Mock <IBattleShipFactory>().Object;
            var engineStub  = new Mock <IEngine>().Object;

            var cmd = new CreatePlayerCommand(factoryStub, engineStub);

            Assert.ThrowsException <ArgumentNullException>(() => cmd.Execute(null));
        }
Exemple #2
0
        public void ExecuteShouldThrowArgumentExceptionWhenParametersIsEmpty()
        {
            var factoryStub = new Mock <IBattleShipFactory>().Object;
            var engineStub  = new Mock <IEngine>().Object;

            var parameters = new List <string>();

            var cmd = new CreatePlayerCommand(factoryStub, engineStub);

            Assert.ThrowsException <ArgumentException>(() => cmd.Execute(parameters));
        }