public void GetLocalities() { Way way = EntitySetuper.SetupWayWithTarif(_context); LocalityModel expectedGet = new LocalityModel(way.LocalityGetLocalityId, way.LocalityGet.NameEn); LocalityModel expectedSend = new LocalityModel(way.LocalitySandLocalityId, way.LocalitySand.NameEn); List <LocalityModel> result = _localityService.GetLocalities(); Assert.AreEqual(expectedSend, result[0]); Assert.AreEqual(expectedGet, result[1]); Assert.AreEqual(2, result.Count); }
public void GetLocalities() { Locality locality = ServicesTestConstant.getLocalityGet(); List <Locality> localities = new List <Locality> { locality }; LocalityModel localityDto = new LocalityModel(locality.LocalityId, locality.NameEn); _localityRepository.Setup(s => s.Get(null, null)).Returns(localities); List <LocalityModel> result = _localityService.GetLocalities(); _localityRepository.Verify( place => place.Get(null, null), Times.Once()); Assert.AreEqual(localityDto, result[0]); Assert.AreEqual(localities.Count, result.Count); }