BusinessLogic.Tests.UnitTests.LogicTests.SecurityTests.LinkedPlayedGameValidatorTests.ValidateTests.It_Throws_An_InvalidSourceException_If_One_Of_The_External_Source_Fields_Is_Set_But_Not_The_Other C# (CSharp) Method

It_Throws_An_InvalidSourceException_If_One_Of_The_External_Source_Fields_Is_Set_But_Not_The_Other() private method

private It_Throws_An_InvalidSourceException_If_One_Of_The_External_Source_Fields_Is_Set_But_Not_The_Other ( string applicationName, string externalSourceEntityId ) : void
applicationName string
externalSourceEntityId string
return void
        public void It_Throws_An_InvalidSourceException_If_One_Of_The_External_Source_Fields_Is_Set_But_Not_The_Other(
            string applicationName,
            string externalSourceEntityId)
        {
            //--arrange
            var newlyCompletedGame = CreateNewlyCompletedGame();
            var applicationLinkage = new ApplicationLinkage
            {
                ApplicationName = applicationName,
                EntityId = externalSourceEntityId
            };
            newlyCompletedGame.ApplicationLinkages.Add(applicationLinkage);

            var expectedException = new InvalidSourceException(applicationName, externalSourceEntityId);

            //--act
            var exception = Assert.Throws<InvalidSourceException>(() => _autoMocker.ClassUnderTest.Validate(newlyCompletedGame));

            //--assert
            exception.Message.ShouldBe(expectedException.Message);
        }