public async void TestDelete() { ConnectionFactory connectionFactory = new ConnectionFactory(Environment.Testing); ILocationDao locationDao = new LocationDao(connectionFactory); Location location = await InsertLocation(connectionFactory); Assert.NotNull(await locationDao.FindById(location.Id)); await locationDao.Delete(location.Id); Assert.Null(await locationDao.FindById(location.Id)); }
public async void TestFindById() { ConnectionFactory connectionFactory = new ConnectionFactory(Environment.Testing); ILocationDao locationDao = new LocationDao(connectionFactory); Location location = await InsertLocation(connectionFactory); Location locationFound = await locationDao.FindById(location.Id); Assert.Equal(location.Name, locationFound.Name); }
public async void TestUpdate() { ConnectionFactory connectionFactory = new ConnectionFactory(Environment.Testing); ILocationDao locationDao = new LocationDao(connectionFactory); Location location = await InsertLocation(connectionFactory); location.Name = "Hinterstoder"; await locationDao.Update(location); Location locationAfter = await locationDao.FindById(location.Id); Assert.Equal(location.Name, locationAfter.Name); }