Esempio n. 1
0
		public void YMDHConstructorWorks() {
			var dt = new JsDate(2011, 7, 12, 13);
			Assert.AreEqual(dt.GetFullYear(), 2011);
			Assert.AreEqual(dt.GetMonth(), 7);
			Assert.AreEqual(dt.GetDate(), 12);
			Assert.AreEqual(dt.GetHours(), 13);
		}
Esempio n. 2
0
		public void YMDHNSConstructorWorks() {
			var dt = new JsDate(2011, 7, 12, 13, 42, 56);
			Assert.AreEqual(dt.GetFullYear(), 2011);
			Assert.AreEqual(dt.GetMonth(), 7);
			Assert.AreEqual(dt.GetDate(), 12);
			Assert.AreEqual(dt.GetHours(), 13);
			Assert.AreEqual(dt.GetMinutes(), 42);
			Assert.AreEqual(dt.GetSeconds(), 56);
		}
 public void ConvertingMutableDateToDateReturnsANewButEqualInstance()
 {
     var mdt = new JsDate(2011, 7, 12);
     DateTime dt = (DateTime)mdt;
     Assert.IsFalse((object)dt == (object)mdt);
     Assert.AreEqual(mdt.GetFullYear(), 2011);
     Assert.AreEqual(mdt.GetMonth(), 7);
     Assert.AreEqual(mdt.GetDate(), 12);
 }
Esempio n. 4
0
        public void SetFullYearWithThreeParametersWorks() {
			var dt = new JsDate(2000, 0, 1);
			dt.SetFullYear(2021, 7, 13);
			Assert.AreEqual(dt.GetFullYear(), 2021);
			Assert.AreEqual(dt.GetMonth(), 7);
			Assert.AreEqual(dt.GetDate(), 13);
        }
Esempio n. 5
0
		public void StringConstructorWorks() {
			var dt = new JsDate("Aug 12, 2012");
			Assert.AreEqual(dt.GetFullYear(), 2012);
			Assert.AreEqual(dt.GetMonth(), 7);
			Assert.AreEqual(dt.GetDate(), 12);
		}
Esempio n. 6
0
        public void SetFullYearWithOneParameterWorks() {
			var dt = new JsDate(2000, 0, 1);
			dt.SetFullYear(2021);
			Assert.AreEqual(dt.GetFullYear(), 2021);
        }
Esempio n. 7
0
		public void MillisecondSinceEpochConstructorWorks() {
			var dt = new JsDate(1440L * 60 * 500 * 1000);
			Assert.AreEqual(dt.GetFullYear(), 1971);
		}
Esempio n. 8
0
		public void DefaultConstructorReturnsTodaysDate() {
			var dt = new JsDate();
			Assert.IsTrue(dt.GetFullYear() > 2011);
		}
Esempio n. 9
0
		public void GetFullYearWorks() {
			var dt = new JsDate(2011, 7, 12, 13, 42, 56, 345);
			Assert.AreEqual(dt.GetFullYear(), 2011);
		}
Esempio n. 10
0
 public void DefaultConstructorWorks()
 {
     var dt = new JsDate();
     Assert.IsTrue(dt.GetFullYear() > 2011);
 }
Esempio n. 11
0
		public void ToLocalWorks() {
			var utc = new JsDate(2011, 7, 12, 13, 42, 56, 345);
			var dt = utc.ToLocalTime();
			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());
		}