public async Task Update() { IStationTypeDao stationTypeDao = new AdoStationTypeDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName)); StationType stationType = await stationTypeDao.FindByIdAsync(1); string manufacturer = stationType.Manufacturer; stationType.Manufacturer = "Test"; bool update1 = await stationTypeDao.UpdateAllAsync(stationType); Assert.IsTrue(update1); StationType stationType1 = await stationTypeDao.FindByIdAsync(1); Assert.IsTrue(stationType1.Manufacturer == "Test"); stationType.Manufacturer = manufacturer; bool update2 = await stationTypeDao.UpdateAllAsync(stationType); Assert.IsTrue(update2); StationType stationType2 = await stationTypeDao.FindByIdAsync(1); Assert.IsTrue(stationType2.Manufacturer == manufacturer); }
public async Task FindById() { IStationTypeDao stationTypeDao = new AdoStationTypeDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName)); StationType stationType = await stationTypeDao.FindByIdAsync(1); Assert.IsTrue(stationType != null && stationType.Id == 1); }