예제 #1
0
        public static TestContext getTestContext(DateTimeOffset? viewDate = null, IConditionalEvaluator evaluator = null, ICustomElementProvider provider = null)
        {
            DateTimeOffset realDate = viewDate ?? DateTimeOffset.Now;

            var db = getDataContext();

            var trrepo = new TreeRepository(db);
            var blrepo = new StreamedBlobRepository(db);
            var tpsbrepo = new TreePathStreamedBlobRepository(db, blrepo);

            return new TestContext(new ContentEngine(trrepo, blrepo, tpsbrepo, realDate, evaluator, provider), trrepo, blrepo, tpsbrepo);
        }
예제 #2
0
        public SQLSystemContext(string dataSource)
        {
            // @"Data Source=.\SQLEXPRESS;Initial Catalog=IVO;Integrated Security=SSPI"
            Asynq.DataContext db = new Asynq.DataContext(dataSource);

            TreeRepository trrepo = new TreeRepository(db);
            StreamedBlobRepository blrepo = new StreamedBlobRepository(db);
            TreePathStreamedBlobRepository tpsbrepo = new TreePathStreamedBlobRepository(db, blrepo);
            TagRepository tgrepo = new TagRepository(db);
            RefRepository rfrepo = new RefRepository(db);
            StageRepository strepo = new StageRepository(db);
            CommitRepository cmrepo = new CommitRepository(db);

            this.trrepo = trrepo;
            this.blrepo = blrepo;
            this.tpsbrepo = tpsbrepo;
            this.tgrepo = tgrepo;
            this.rfrepo = rfrepo;
            this.strepo = strepo;
            this.cmrepo = cmrepo;

            this.db = db;
        }