Exemplo n.º 1
0
 public void NewCitiesCheker(HexTile hexTile)
 {
     foreach (var city in CityUtils.CityCheckStart(hexTile.Data))
     {
         MyCities.Add(city);
     }
 }
        public void GetCities_Must_Return_List_Of_All_Cities()
        {
            //Arrange
            var cities = new List <City>
            {
                CityUtils.Create(1, "aaaa"),
                CityUtils.Create(2, "bbbb", true),
                CityUtils.Create(3, "dddd"),
                CityUtils.Create(4, "eeee")
            };

            var repository = new Mock <ICityRepository>();

            repository.Setup(act => act.GetAll(true)).Returns(cities.AsQueryable);
            _unitOfWorkMock.Setup(act => act.Repository <ICityRepository>()).Returns(repository.Object);

            //Act
            var result = _manager.GetCities();

            //Assert
            Assert.AreEqual(3, result.Count());
            Assert.AreEqual(cities[0].Name, result.ElementAt(0).Name);
            Assert.AreEqual(cities[2].Name, result.ElementAt(1).Name);
            Assert.AreEqual(cities[3].Name, result.ElementAt(2).Name);
        }
Exemplo n.º 3
0
 protected override void Merge(City source, City target)
 {
     CityUtils.Merge(source, target);
 }
Exemplo n.º 4
0
 protected override QueryFilters <CityProperty> GetChanges(City original, City changed)
 {
     return(CityUtils.GetChanges(original, changed));
 }