Exemplo n.º 1
0
        public void TestSerialization()
        {
            var dio        = DtzIoHelper.CreateNoStringPool();
            var yearOffset = new ZoneYearOffset(TransitionMode.Utc, 10, 31, (int)IsoDayOfWeek.Wednesday, true, LocalTime.Midnight);
            var expected   = new ZoneRecurrence("bob", Offset.Zero, yearOffset, 1971, 2009);

            dio.TestZoneRecurrence(expected);
        }
Exemplo n.º 2
0
        public void Serialization()
        {
            var dio      = DtzIoHelper.CreateNoStringPool();
            var expected = new ZoneYearOffset(TransitionMode.Utc, 10, 31, (int)IsoDayOfWeek.Wednesday, true, LocalTime.Midnight);

            dio.TestZoneYearOffset(expected);

            dio.Reset();
            expected = new ZoneYearOffset(TransitionMode.Utc, 10, -31, (int)IsoDayOfWeek.Wednesday, true, LocalTime.Midnight);
            dio.TestZoneYearOffset(expected);
        }
Exemplo n.º 3
0
        public void Read_NoNameInStream()
        {
            var ioHelper = DtzIoHelper.CreateNoStringPool();
            var offset   = Offset.FromHours(5);

            ioHelper.Writer.WriteOffset(offset);
            var zone = (FixedDateTimeZone)FixedDateTimeZone.Read(ioHelper.Reader, "id");

            Assert.AreEqual("id", zone.Id);
            Assert.AreEqual(offset, zone.Offset);
            Assert.AreEqual("id", zone.Name);
        }
Exemplo n.º 4
0
        public void Roundtrip()
        {
            var ioHelper = DtzIoHelper.CreateNoStringPool();
            var oldZone  = new FixedDateTimeZone("id", Offset.FromHours(4), "name");

            oldZone.Write(ioHelper.Writer);
            var newZone = (FixedDateTimeZone)FixedDateTimeZone.Read(ioHelper.Reader, "id");

            Assert.AreEqual(oldZone.Id, newZone.Id);
            Assert.AreEqual(oldZone.Offset, newZone.Offset);
            Assert.AreEqual(oldZone.Name, newZone.Name);
        }