public async Task FindByName() { IProvinceDao provinceDao = new AdoProvinceDao(DefaultConnectionFactory.FromConfiguration(configName)); IEnumerable <Province> provinces; provinces = await provinceDao.FindByNameAsync("Oberösterreich"); Assert.IsTrue(provinces.Any()); provinces = await provinceDao.FindByNameAsync("Freistadt"); Assert.IsFalse(provinces.Any()); }
public async Task Delete() { IProvinceDao provinceDao = new AdoProvinceDao(DefaultConnectionFactory.FromConfiguration(configName)); Province province = new Province("Bayern"); bool inserted = await provinceDao.AddProvinceAsync(province); Assert.IsTrue(inserted); province = (await provinceDao.FindByNameAsync("Bayern")).FirstOrDefault(); bool deleted = await provinceDao.DeleteProvinceAsync(province); Assert.IsTrue(deleted); province = (await provinceDao.FindByNameAsync("Bayern")).FirstOrDefault(); Assert.IsNull(province); }