Esempio n. 1
0
 public void Equality()
 {
     TestHelper.TestEqualsClass(
         // Equal values
         new ZoneInterval("name", SampleStart, SampleEnd, Offset.FromHours(1), Offset.FromHours(2)),
         new ZoneInterval("name", SampleStart, SampleEnd, Offset.FromHours(1), Offset.FromHours(2)),
         // Unequal values
         new ZoneInterval("name2", SampleStart, SampleEnd, Offset.FromHours(1), Offset.FromHours(2)),
         new ZoneInterval("name", SampleStart.PlusNanoseconds(1), SampleEnd, Offset.FromHours(1), Offset.FromHours(2)),
         new ZoneInterval("name", SampleStart, SampleEnd.PlusNanoseconds(1), Offset.FromHours(1), Offset.FromHours(2)),
         new ZoneInterval("name", SampleStart, SampleEnd, Offset.FromHours(2), Offset.FromHours(2)),
         new ZoneInterval("name", SampleStart, SampleEnd, Offset.FromHours(1), Offset.FromHours(3)));
 }
Esempio n. 2
0
        public void PlusNanoseconds()
        {
            Instant instant = Instant.FromUnixTimeTicks(5);

            Assert.AreEqual(Instant.FromUnixTimeTicks(8), instant.PlusNanoseconds(300));
        }
 /// <summary>
 /// Add nanoseconds
 /// </summary>
 /// <param name="i"></param>
 /// <param name="nanoseconds"></param>
 /// <returns></returns>
 public static Instant AddNanoseconds(this Instant i, long nanoseconds) => i.PlusNanoseconds(nanoseconds);