System.Globalization.Tests.CultureInfoMiscTests.CultureNotFoundExceptionTest C# (CSharp) Méthode

CultureNotFoundExceptionTest() private méthode

private CultureNotFoundExceptionTest ( ) : void
Résultat void
        public void CultureNotFoundExceptionTest()
        {
            Assert.Throws<CultureNotFoundException>("name", () => new CultureInfo("!@#$%^&*()"));
            Assert.Throws<CultureNotFoundException>("name", () => new CultureInfo("This is invalid culture"));
            Assert.Throws<CultureNotFoundException>("name", () => new CultureInfo("longCulture" + new string('a', 100)));
            Assert.Throws<CultureNotFoundException>("culture", () => new CultureInfo(0x1000));

            CultureNotFoundException e = Assert.Throws<CultureNotFoundException>("name", () => new CultureInfo("This is invalid culture"));
            Assert.Equal("This is invalid culture", e.InvalidCultureName);

            e = Assert.Throws<CultureNotFoundException>("culture", () => new CultureInfo(0x1000));
            Assert.Equal(0x1000, e.InvalidCultureId);
        }
    }