BusinessLogic.Tests.UnitTests.LogicTests.PlayersTests.PlayerSaverTests.CreatePlayerTests.ItThrowsAPlayerAlreadyExistsExceptionIfAttemptingToSaveAPlayerWithANameThatAlreadyExists C# (CSharp) Method

ItThrowsAPlayerAlreadyExistsExceptionIfAttemptingToSaveAPlayerWithANameThatAlreadyExists() private method

        public void ItThrowsAPlayerAlreadyExistsExceptionIfAttemptingToSaveAPlayerWithANameThatAlreadyExists()
        {
            _createPlayerRequest.Name = _playerThatAlreadyExists.Name;

            var exception = Assert.Throws<PlayerAlreadyExistsException>(
                () => _autoMocker.ClassUnderTest.CreatePlayer(_createPlayerRequest, _currentUser));

            Assert.AreEqual(_idOfPlayerThatAlreadyExists, exception.ExistingPlayerId);
        }
    }