public void DeleteTest()
        {
            using (var unitOfWork = new SqLiteUnitOfWork(_sqliteDtabase.Connect())) {
                var customerRepository = _repositoryFactory.CreateRepository<Customer>();
                var shippingAddressRepository =
                    _repositoryFactory.CreateRepository<ShippingAddress>();

                var customer = new CustomerProxy(shippingAddressRepository) {
                    Id = 1,
                    Name = "Test User"
                };
                unitOfWork.BeginTransaction();
                customerRepository.Save(customer);
                unitOfWork.Commit();
                int expectedCount = 1;
                int actualCount = customerRepository.Find().GetCount();
                Assert.AreEqual(expectedCount, actualCount);

                unitOfWork.BeginTransaction();
                customerRepository.Delete(customer);
                unitOfWork.Commit();
                expectedCount = 0;
                actualCount = customerRepository.Find().GetCount();
                Assert.AreEqual(expectedCount, actualCount);
            }
        }
        private void ApplyDatabaseSchema(IStorage storage,
                                                string databaseScriptFullPath)
        {
            string schemaScript;
            using (StreamReader reader = File.OpenText(databaseScriptFullPath)) {
                schemaScript = reader.ReadToEnd();
            }

            IDbConnection connection = storage.Connect();
            using (var unitOfWork = new SqLiteUnitOfWork(storage.Connect())) {
                unitOfWork.BeginTransaction();
                using (IDbCommand command = connection.CreateCommand()) {
                    command.CommandText = schemaScript;
                    command.ExecuteNonQuery();
                }
                unitOfWork.Commit();
            }
        }
        public void SaveTest()
        {
            using (var unitOfWork = new SqLiteUnitOfWork(_sqliteDtabase.Connect())) {
                var customerRepository = _repositoryFactory.CreateRepository<Customer>();
                var shippingAddressRepository =
                    _repositoryFactory.CreateRepository<ShippingAddress>();
                var customer = new CustomerProxy(shippingAddressRepository) {
                    Id = 1,
                    Name = "Test User"
                };

                unitOfWork.BeginTransaction();
                customerRepository.Save(customer);
                unitOfWork.Commit();
                const int expectedCount = 1;
                int actualCount = customerRepository.Find().GetCount();
                Assert.AreEqual(expectedCount, actualCount);

                const string expectedCustomerName = "ModyfiedName";
                customer.Name = expectedCustomerName;
                unitOfWork.BeginTransaction();
                customerRepository.Save(customer);
                unitOfWork.Commit();
                string actualName = customerRepository.GetById(customer.Id).Name;
                Assert.AreEqual(expectedCustomerName, actualName);
            }
        }