Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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);
        }