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