public void TestConstructor()
        {
            var locationName   = "location name";
            var latitude       = 1.0f;
            var longitude      = 2.0f;
            var cityId         = 2;
            var countryId      = 3;
            var divisionId     = 4;
            var regionId       = 5;
            var locationTypeId = LocationType.Place.Id;
            var model          = new EcaLocation(locationName, cityId, countryId, divisionId, regionId, latitude, longitude, locationTypeId);
            var country        = new Location();
            var city           = new Location();
            var division       = new Location();
            var region         = new Location();

            var entity = new LocationValidationEntity(model, region, country, division, city);

            Assert.AreEqual(model.LocationName, entity.LocationName);
            Assert.AreEqual(model.LocationTypeId, entity.LocationTypeId);
            Assert.AreEqual(model.Latitude, entity.Latitude);
            Assert.AreEqual(model.Longitude, entity.Longitude);
            Assert.IsTrue(Object.ReferenceEquals(city, entity.City));
            Assert.IsTrue(Object.ReferenceEquals(division, entity.Division));
            Assert.IsTrue(Object.ReferenceEquals(country, entity.Country));
            Assert.IsTrue(Object.ReferenceEquals(region, entity.Region));
        }
Пример #2
0
 public void TestConstructor_LocationTypeUnknown()
 {
     var locationName   = "location name";
     var latitude       = 1.0f;
     var longitude      = 2.0f;
     var cityId         = 2;
     var countryId      = 3;
     var divisionId     = 4;
     var regionId       = 5;
     var locationTypeId = -1;
     var model          = new EcaLocation(locationName, cityId, countryId, divisionId, regionId, latitude, longitude, locationTypeId);
 }
Пример #3
0
        public void TestConstructor()
        {
            var locationName   = "location name";
            var latitude       = 1.0f;
            var longitude      = 2.0f;
            var cityId         = 2;
            var countryId      = 3;
            var divisionId     = 4;
            var regionId       = 5;
            var locationTypeId = LocationType.Place.Id;
            var model          = new EcaLocation(locationName, cityId, countryId, divisionId, regionId, latitude, longitude, locationTypeId);

            Assert.AreEqual(locationName, model.LocationName);
            Assert.AreEqual(latitude, model.Latitude);
            Assert.AreEqual(longitude, model.Longitude);
            Assert.AreEqual(cityId, model.CityId);
            Assert.AreEqual(countryId, model.CountryId);
            Assert.AreEqual(divisionId, model.DivisionId);
            Assert.AreEqual(locationTypeId, model.LocationTypeId);
        }