예제 #1
0
        public void Should_stringify_an_expiry_to_gmt_and_stupid_format()
        {
            // Given
            var date = new DateTime(2015, 10, 8, 9, 10, 11, DateTimeKind.Utc);

            // When
            var cookie = new NancyCookie("leto", "worm") { Expires = date }.ToString();

            // Then
            cookie.ShouldEqual("leto=worm; path=/; expires=Thu, 08-Oct-2015 09:10:11 GMT");
        }
예제 #2
0
        public void Should_stringify_an_expiry_to_english()
        {
            var originalCulture = Thread.CurrentThread.CurrentCulture;
            try
            {
                // Given
                Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
                var date = new DateTime(2015, 10, 8, 9, 10, 11, DateTimeKind.Utc);

                // When
                var cookie = new NancyCookie("leto", "worm") { Expires = date }.ToString();

                // Then
                cookie.ShouldEqual("leto=worm; path=/; expires=Thu, 08-Oct-2015 09:10:11 GMT");
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = originalCulture;
            }
        }