示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }