예제 #1
0
 public static void Initialize(TestContext context)
 {
     //Configure the UowFactory to create a new database and seed sample data
     UowFactory.Configure(true, true);
     DeleteDbFile();
     //create the unit of work to be tested
     Uow = (UnitOfWork)UowFactory.CreateUnitOfWork("DefaultConnection");
 }
예제 #2
0
        public static void Initialize(TestContext context)
        {
            //Configure the UowFactory to create a new database and seed sample data
            UowFactory.Configure(true, true);
            DeleteDbFile();

            var configurator = new EndpointConfigurator();
            var config       = configurator.Configure(new HttpConfiguration());

            Server = new HttpServer(config);
            Client = new HttpClient(Server);
        }
예제 #3
0
        public static void Initialize(TestContext context)
        {
            //Configure the UowFactory to create a new database and seed sample data
            UowFactory.Configure(true, true);
            DeleteDbFile();

            //create an instance to be used in test
            IUnitOfWork Uow  = UowFactory.CreateUnitOfWork("DefaultConnection");
            var         repo = Uow.GetEntityRepository <Product>();
            var         item = new Product()
            {
                Name = "Pro one", Category = "Best Seller"
            };
            var inserted = repo.InsertOrUpdate(item);

            Uow.Commit();
            EntityId = inserted.Id;
        }
예제 #4
0
 static UowController()
 {
     UowFactory.Configure(false, true);
 }