Esempio n. 1
0
            public void InvalidTzName()
            {
                string tzName = "Lunar Standard Time";
                var    html   = CreateHtmlHelper(new ViewDataDictionary());

                SrkHtmlExtensions.SetTimezone(html, tzName);
            }
Esempio n. 2
0
            public void EmptyTzName()
            {
                string tzName = string.Empty;
                var    html   = CreateHtmlHelper(new ViewDataDictionary());

                SrkHtmlExtensions.SetTimezone(html, tzName);
            }
Esempio n. 3
0
            public void WorksWithTzObject2()
            {
                var data = new ViewDataDictionary();
                var tz   = TimeZoneInfo.FindSystemTimeZoneById("Russia Time Zone 3");
                var html = CreateHtmlHelper(data);

                SrkHtmlExtensions.SetTimezone(html, tz);

                Assert.IsNotNull(data["Timezone"]);
                Assert.AreEqual(tz, data["Timezone"]);
            }
Esempio n. 4
0
            public void WorksWithTzName1()
            {
                var data   = new ViewDataDictionary();
                var tzName = "Romance Standard Time";
                var tz     = TimeZoneInfo.FindSystemTimeZoneById(tzName);
                var html   = CreateHtmlHelper(data);

                SrkHtmlExtensions.SetTimezone(html, tzName);

                Assert.IsNotNull(data["Timezone"]);
                Assert.AreEqual(tz, data["Timezone"]);
            }
Esempio n. 5
0
            public void GetterWorks2()
            {
                var data   = new ViewDataDictionary();
                var tzName = "Russia Time Zone 3";
                var tz     = TimeZoneInfo.FindSystemTimeZoneById(tzName);
                var html   = CreateHtmlHelper(data);

                SrkHtmlExtensions.SetTimezone(html, tzName);
                var result = SrkHtmlExtensions.GetTimezone(html);

                Assert.IsNotNull(result);
                Assert.AreEqual(tz, result);
            }