Exemplo n.º 1
0
        public void GeoNames_TimeZone_ShouldOverrideToString()
        {
            var model = new TimeZoneExtended
            {
                Id = "id",
            };

            model.ShouldNotBeNull();
            model.ToString().ShouldEqual(model.Id);
        }
Exemplo n.º 2
0
        public void GeoNames_TimeZone_ShouldOverrideToString()
        {
            var model = new TimeZoneExtended
            {
                Id = "id",
            };

            model.ShouldNotBeNull();
            model.ToString().ShouldEqual(model.Id);
        }
Exemplo n.º 3
0
        public void GeoNames_TimeZone_ShouldBePublic()
        {
            DateTime refTimeA = DateTime.Now;
            DateTime refTimeB = refTimeA.AddMinutes(1);
            DateTime refTimeC = refTimeA.AddMinutes(2);
            var model = new TimeZoneExtended
            {
                Id = "id",
                CountryCode = "cc",
                CountryName = "some name",
                DstOffset = 1.0,
                GmtOffset = 2.0,
                Latitude = 3.0,
                Longitude = 4.0,
                RawOffset = 5.0,
                // Kevin Hollingshead ([email protected])
                // DateTimes aren't working, giving an error that reflects that the
                // JSON deserializer is expecting an obsolete format ("/Date = .../")
                // and I'm not sure how to fix it right now. Ping me if you need these
                // and I'll try to help find a solution.
                //Sunrise = refTimeA,
                //Sunset = refTimeB,
                //Time = refTimeC,
            };

            model.ShouldNotBeNull();
            model.Id.ShouldEqual("id");
            model.CountryCode.ShouldEqual("cc");
            model.CountryName.ShouldEqual("some name");
            model.DstOffset.ShouldEqual(1.0);
            model.GmtOffset.ShouldEqual(2.0);
            model.Latitude.ShouldEqual(3.0);
            model.Longitude.ShouldEqual(4.0);
            model.RawOffset.ShouldEqual(5.0);
            //model.Sunrise.ShouldEqual(refTimeA);
            //model.Sunset.ShouldEqual(refTimeB);
            //model.Time.ShouldEqual(refTimeC);
        }
Exemplo n.º 4
0
        public void GeoNames_TimeZone_ShouldBePublic()
        {
            DateTime refTimeA = DateTime.Now;
            DateTime refTimeB = refTimeA.AddMinutes(1);
            DateTime refTimeC = refTimeA.AddMinutes(2);
            var      model    = new TimeZoneExtended
            {
                Id          = "id",
                CountryCode = "cc",
                CountryName = "some name",
                DstOffset   = 1.0,
                GmtOffset   = 2.0,
                Latitude    = 3.0,
                Longitude   = 4.0,
                RawOffset   = 5.0,
                // Kevin Hollingshead ([email protected])
                // DateTimes aren't working, giving an error that reflects that the
                // JSON deserializer is expecting an obsolete format ("/Date = .../")
                // and I'm not sure how to fix it right now. Ping me if you need these
                // and I'll try to help find a solution.
                //Sunrise = refTimeA,
                //Sunset = refTimeB,
                //Time = refTimeC,
            };

            model.ShouldNotBeNull();
            model.Id.ShouldEqual("id");
            model.CountryCode.ShouldEqual("cc");
            model.CountryName.ShouldEqual("some name");
            model.DstOffset.ShouldEqual(1.0);
            model.GmtOffset.ShouldEqual(2.0);
            model.Latitude.ShouldEqual(3.0);
            model.Longitude.ShouldEqual(4.0);
            model.RawOffset.ShouldEqual(5.0);
            //model.Sunrise.ShouldEqual(refTimeA);
            //model.Sunset.ShouldEqual(refTimeB);
            //model.Time.ShouldEqual(refTimeC);
        }