public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertLocality2FromJson_WithNullCountry() { var json = new JsonPlace { Locality2Name = "locality2 name", Locality2 = null, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Locality2.ShouldNotBeNull(); model.Locality2.Name.ShouldEqual("locality2 name"); model.Locality2.Type.ShouldBeNull(); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertTypeFromJson_WithNullType() { var json = new JsonPlace { TypeName = "type name", Type = null, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Type.ShouldNotBeNull(); model.Type.Name.ShouldEqual("type name"); model.Type.Code.ShouldEqual(default(int)); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertCountryFromJson_WithNullCountry() { var json = new JsonPlace { CountryName = "country name", Country = null, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Country.ShouldNotBeNull(); model.Country.Name.ShouldEqual("country name"); model.Country.Code.ShouldBeNull(); model.Country.Type.ShouldBeNull(); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertAdmin3FromJson_WithNullCountry() { var json = new JsonPlace { Admin3Name = "admin3 name", Admin3 = null, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Admin3.ShouldNotBeNull(); model.Admin3.Name.ShouldEqual("admin3 name"); model.Admin3.Code.ShouldBeNull(); model.Admin3.Type.ShouldBeNull(); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertTypeFromJson_WithNonNullTypeValues() { var json = new JsonPlace { TypeName = "type name", Type = new JsonPlaceTypeAttributes { Code = 11, }, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Type.ShouldNotBeNull(); model.Type.Name.ShouldEqual("type name"); model.Type.Code.ShouldEqual(11); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertAutosFromJson() { var json = new JsonPlace { WoeId = 72, Name = "name", Language = "language", Uri = new Uri("http://ngeo.codeplex.com"), Center = new Point { Latitude = 9.84, Longitude = 52.445, }, BoundingBox = new BoundingBox { Northeast = new Point { Latitude = 8.541, Longitude = 77.93, }, Southwest = new Point { Latitude = 4.362, Longitude = 129.63, }, }, AreaRank = 43, PopulationRank = 33, Postal = "postal", }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.WoeId.ShouldEqual(json.WoeId); model.Name.ShouldEqual(json.Name); model.Language.ShouldEqual(json.Language); model.Center.ShouldNotBeNull(); model.Center.ShouldEqual(json.Center); model.Center.Latitude.ShouldEqual(json.Center.Latitude); model.Center.Longitude.ShouldEqual(json.Center.Longitude); model.BoundingBox.ShouldNotBeNull(); model.BoundingBox.Northeast.ShouldNotBeNull(); model.BoundingBox.Northeast.Latitude.ShouldEqual(json.BoundingBox.Northeast.Latitude); model.BoundingBox.Northeast.Longitude.ShouldEqual(json.BoundingBox.Northeast.Longitude); model.BoundingBox.Southwest.ShouldNotBeNull(); model.BoundingBox.Southwest.Latitude.ShouldEqual(json.BoundingBox.Southwest.Latitude); model.BoundingBox.Southwest.Longitude.ShouldEqual(json.BoundingBox.Southwest.Longitude); model.AreaRank.ShouldEqual(json.AreaRank); model.PopulationRank.ShouldEqual(json.PopulationRank); model.Postal.ShouldEqual(json.Postal); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertLocality2FromJson_WithNonNullValues() { var json = new JsonPlace { Locality2Name = "locality2 name", Locality2 = new JsonLocalityAttributes { Type = "locality2 type" }, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Locality2.ShouldNotBeNull(); model.Locality2.Name.ShouldEqual("locality2 name"); model.Locality2.Type.ShouldEqual("locality2 type"); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertAdmin3FromJson_WithNonNullValues() { var json = new JsonPlace { Admin3Name = "admin3 name", Admin3 = new JsonAdminAttributes { Code = "admin3 code", Type = "admin3 type" }, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Admin3.ShouldNotBeNull(); model.Admin3.Name.ShouldEqual("admin3 name"); model.Admin3.Code.ShouldEqual("admin3 code"); model.Admin3.Type.ShouldEqual("admin3 type"); }
public void Yahoo_GeoPlanet_JsonConverter_ToPlace_ShouldConvertCountryFromJson_WithNonNullValues() { var json = new JsonPlace { CountryName = "country name", Country = new JsonAdminAttributes { Code = "country code", Type = "country type" }, }; var model = json.ToPlace(); model.ShouldNotBeNull(); model.Country.ShouldNotBeNull(); model.Country.Name.ShouldEqual("country name"); model.Country.Code.ShouldEqual("country code"); model.Country.Type.ShouldEqual("country type"); }