Пример #1
0
        public void TestLocationRepo_CheckRepo()
        {
            var locationRepo = new LocationRepo(TripLineConfig.LocationRepoPath + "2", forceNew: true);

            Assert.IsTrue(locationRepo.Content.Locations.Count == 0);

            locationRepo.Add(new Location()
            {
                City = "Montreal"
            });


            locationRepo.Save();

            Assert.IsTrue(locationRepo.Content.Locations.Count == 1);

            locationRepo.ClearContent();

            Assert.IsTrue(locationRepo.Content.Locations.Count == 0);

            // reload to see iuf they are really saved
            locationRepo.Reload();

            // Check
            Assert.IsTrue(locationRepo.Content.Locations.Count == 1);

            Assert.IsTrue(locationRepo.Content.Locations[0].City == "Montreal");
        }
Пример #2
0
 public void Add(Location location)
 {
     repo.Add(location);
 }