Exemplo n.º 1
0
        public void SetUtcFullYearWithOneParameterWorks()
        {
            var dt = new JsDate(JsDate.Utc(2000, 0, 1));

            dt.SetUtcFullYear(2021);
            Assert.AreEqual(dt.GetUtcFullYear(), 2021);
        }
        public void SetUtcFullYearWithTwoParametersWorks()
        {
            var dt = new JsDate(DateTime.Utc(2000, 0, 1));

            dt.SetUtcFullYear(2021, 7);
            Assert.AreEqual(dt.GetUtcFullYear(), 2021);
            Assert.AreEqual(dt.GetUtcMonth(), 7);
        }
Exemplo n.º 3
0
 private void AssertDateUtc(JsDate dt, int year, int month, int day, int hours, int minutes, int seconds, int milliseconds)
 {
     Assert.AreEqual(dt.GetUtcFullYear(), year);
     Assert.AreEqual(dt.GetUtcMonth(), month);
     Assert.AreEqual(dt.GetUtcDate(), day);
     Assert.AreEqual(dt.GetUtcHours(), hours);
     Assert.AreEqual(dt.GetUtcMinutes(), minutes);
     Assert.AreEqual(dt.GetUtcSeconds(), seconds);
     Assert.AreEqual(dt.GetUtcMilliseconds(), milliseconds);
 }
Exemplo n.º 4
0
        public void ToUniversalWorks()
        {
            var dt  = new JsDate(2011, 7, 12, 13, 42, 56, 345);
            var utc = dt.ToUniversalTime();

            Assert.AreEqual(dt.GetUtcFullYear(), utc.GetFullYear());
            Assert.AreEqual(dt.GetUtcMonth(), utc.GetMonth());
            Assert.AreEqual(dt.GetUtcDate(), utc.GetDate());
            Assert.AreEqual(dt.GetUtcHours(), utc.GetHours());
            Assert.AreEqual(dt.GetUtcMinutes(), utc.GetMinutes());
            Assert.AreEqual(dt.GetUtcSeconds(), utc.GetSeconds());
            Assert.AreEqual(dt.GetUtcMilliseconds(), utc.GetMilliseconds());
        }
Exemplo n.º 5
0
        public void GetUtcFullYearWorks()
        {
            var dt = new JsDate(JsDate.Utc(2011, 7, 12, 13, 42, 56, 345));

            Assert.AreEqual(dt.GetUtcFullYear(), 2011);
        }