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

GetViaDateTimeProperty_WithNonLocalTimeZone_ShouldWorkCorrectly() private method

        public void GetViaDateTimeProperty_WithNonLocalTimeZone_ShouldWorkCorrectly()
        {
            var cd = new ContentDisposition("inline");
            cd.Parameters["creation-date"] = ValidDateTimeNotLocal;
            DateTime result = cd.CreationDate;

            Assert.Equal(ValidDateTimeNotLocal, cd.Parameters["creation-date"]);
            Assert.Equal(DateTimeKind.Local, result.Kind);

            // be sure that the local offset isn't the same as the offset we're testing
            // so that this comparison will be valid
            if (s_localTimeOffset != new TimeSpan(-2, 0, 0))
            {
                Assert.NotEqual(ValidDateTimeNotLocal, result.ToString("ddd, dd MMM yyyy H:mm:ss"));
            }
        }