System.Net.Mime.Tests.ContentDispositionTest.CultureSensitiveSetDateViaProperty_ShouldPersistToProprtyAndParametersCollectionAndRespectKindProperty C# (CSharp) Method

CultureSensitiveSetDateViaProperty_ShouldPersistToProprtyAndParametersCollectionAndRespectKindProperty() private method

        public void CultureSensitiveSetDateViaProperty_ShouldPersistToProprtyAndParametersCollectionAndRespectKindProperty()
        {
            CultureInfo origCulture = CultureInfo.CurrentCulture;
            try
            {
                CultureInfo.CurrentCulture = new CultureInfo("zh");

                var cd = new ContentDisposition("inline");

                var date = new DateTime(2011, 6, 8, 15, 34, 07, DateTimeKind.Unspecified);
                cd.CreationDate = date;

                Assert.Equal("Wed, 08 Jun 2011 15:34:07 -0000", cd.Parameters["creation-date"]);
                Assert.Equal(date, cd.CreationDate);
                Assert.Equal("inline; creation-date=\"Wed, 08 Jun 2011 15:34:07 -0000\"", cd.ToString());
            }
            finally
            {
                CultureInfo.CurrentCulture = origCulture;
            }
        }
    }