public void SuccesStartingGameCorrectCommand() { //Arrange var mock = new Mock <RoomService>(MockBehavior.Strict); var command = new CreateRoomCommand(); mock.Setup(x => x.StartGame(It.Is <CreateRoomCommand>(y => y == command))); var target = new RoomController(mock.Object); //Act target.CreateGame(command); //Assert mock.Verify(x => x.StartGame(It.Is <CreateRoomCommand>(y => y == command)), Times.Once); }