public void AddCustomerTest()
        {
            using(var dataContext = new ModelDataContext())
            using (var unitOfWork = new UnitOfWork(dataContext) )
            {
                var customerID = Guid.NewGuid();

                var customer = new Customer()
                {
                     ID = Guid.NewGuid(),
                     Name = "BBC",
                     Address = "No.1 Bee Street",
                     City = "London",
                     Country = "UK",
                     Region = "AA",
                     Fax = "000000",
                     Phone = "00000000000",
                     PostalCode = "555555"
                };

                var customerRepository = unitOfWork.Repository<Customer>();

                customerRepository.Insert(customer); ;
                unitOfWork.SaveChanges();

                var insertedCustomer = customerRepository.Find(customerID);

                Assert.IsNotNull(insertedCustomer);
                Assert.AreEqual(customerID, insertedCustomer.ID);
            }
        }
        public void GetCustomerTest()
        {
            using (var dataContext = new ModelDataContext())
            using (var unitOfWork = new UnitOfWork(dataContext))
            {
                var customerID = Guid.Parse("46de4e9f-564f-4273-bbd1-45bed3166668");

                var customerRepository = unitOfWork.Repository<Customer>();
                var insertedCustomer = customerRepository.Find(customerID);

                Assert.IsNotNull(insertedCustomer);
                Assert.AreEqual(customerID, insertedCustomer.ID);
            }
        }
        public void QueryByRegionAndCityTest()
        {
            var customerRegion = "AA";
            var customerCity = "London";

            using (var dataContext = new ModelDataContext())
            using (var unitOfWork = new UnitOfWork(dataContext))
            {

                var customerRepository = unitOfWork.Repository<Customer>();

                var customers = customerRepository.SelectByRegionAndCity(customerRegion, customerCity);

                Assert.AreEqual(3, customers.ToList().Count);

            }
        }
        public void QueryCustomersByRegionTest()
        {
            using (var dataContext = new ModelDataContext())
            using (var unitOfWork = new UnitOfWork(dataContext))
            {
                var customerRegion = "AA";

                var customerRepository = unitOfWork.Repository<Customer>();
                var customers = customerRepository.SelectByRegion(customerRegion);

                Assert.AreEqual(3, customers.Count());
            }
        }