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); }
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); }
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); }