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); }