예제 #1
0
파일: LocationTest.cs 프로젝트: amigobv/UFO
        public void FindLocationByIdTest()
        {
            IDatabase database = new Database(TestUtils.ConnString);
            Assert.NotNull(database);

            var locationDao = new LocationDao(database);
            InsertDummyData(locationDao);
            Assert.Equal(items.Count, locationDao.Count());

            var myLocation = locationDao.FindById(HAUPTPLATZ_ID);
            Assert.NotNull(myLocation);
            Assert.Equal(HAUPTPLATZ, myLocation.Label);

            locationDao.Delete(myLocation.Id);
            Assert.Equal(items.Count-1, locationDao.Count());
        }
예제 #2
0
파일: LocationTest.cs 프로젝트: amigobv/UFO
        public void DeleteLocationTest()
        {
            IDatabase database = new Database(TestUtils.ConnString);
            Assert.NotNull(database);

            var locationDao = new LocationDao(database);
            InsertDummyData(locationDao);
            Assert.Equal(items.Count, locationDao.Count());

            foreach (var item in items)
            {
                locationDao.Delete(item.Id);
            }
            Assert.Equal(0, locationDao.Count());
        }