BusinessLogic.Tests.IntegrationTests.LogicTests.PlayedGamesTests.GetPlayedGameDetailsIntegrationTests.ItThrowsAnEntityDoesNotExistExceptionIfTheIdIsInvalid C# (CSharp) Метод

ItThrowsAnEntityDoesNotExistExceptionIfTheIdIsInvalid() приватный Метод

private ItThrowsAnEntityDoesNotExistExceptionIfTheIdIsInvalid ( ) : void
Результат void
        public void ItThrowsAnEntityDoesNotExistExceptionIfTheIdIsInvalid()
        {
            int invalidId = -1;
            var expectedException = new EntityDoesNotExistException(typeof(PlayedGame), invalidId);

            using (NemeStatsDataContext dataContext = new NemeStatsDataContext())
            {
                PlayedGameRetriever retriever = new PlayedGameRetriever(dataContext);

                Exception actualException = Assert.Throws<EntityDoesNotExistException>(() => retriever.GetPlayedGameDetails(invalidId));

                Assert.That(expectedException.Message, Is.EqualTo(actualException.Message));
            }
        }
    }