Exemple #1
0
        public void Delete_Game_Key_Argument_Is_Null()
        {
            // Arrange
            var deleteGameCommand = new DeleteGameCommand { Key = null };

            // Act
            var result = ExceptionAssert.Throws<ArgumentNullException>(() =>
                _commandHandler.Execute(deleteGameCommand));

            // Assert
            _unitOfWorkMock.Verify(x => x.Games, Times.Never);
            Assert.AreEqual("Key", result.ParamName);
        }
Exemple #2
0
        public void Delete_Game_With_Right_Data()
        {
            // Arrange
            var deleteGameCommand = new DeleteGameCommand { Key = "dota-2" };

            // Act
            _commandHandler.Execute(deleteGameCommand);

            // Assert
            _unitOfWorkMock.Verify(x => x.Save(), Times.Once);
        }
Exemple #3
0
        public void Delete_Game_Key_Argument_Doesnt_Match_Exising_Game()
        {
            // Arrange
            var deleteGameCommand = new DeleteGameCommand() { Key = "not-existing-game" };

            // Act
            var result = ExceptionAssert.Throws<ArgumentException>(() =>
                _commandHandler.Execute(deleteGameCommand));

            // Assert
            Assert.AreEqual("Key", result.ParamName);
        }