Exemplo n.º 1
0
        public void CreateNewTestContext()
        {
            if (TContext != null && TContext.TransactionScope != null)
            {
                TContext.Rollback();
            }
            TContext = TestAdmin.TestContext();

            TContext.SetTransactional(System.Data.IsolationLevel.ReadUncommitted);

            db = new Repository(this.TContext);

            this.TContext.ReadOnly = false;
        }
Exemplo n.º 2
0
        public void TestsDataContext_Make_Sure_Entities_With_Timestamp_Fields_Have_Concurrency_Switched_On()
        {
            var ctx1 = TestAdmin.TestContext();
            var ctx2 = TestAdmin.TestContext();

            ctx1.ReadOnly = false;
            ctx2.ReadOnly = false;
            ConcurrencyCheck <Business>(ctx1, ctx1.Businesses, ctx2, ctx2.Businesses);

            ctx1          = TestAdmin.TestContext();
            ctx2          = TestAdmin.TestContext();
            ctx1.ReadOnly = false;
            ctx2.ReadOnly = false;
            ConcurrencyCheck <User>(ctx1, ctx1.Users, ctx2, ctx2.Users);
        }
Exemplo n.º 3
0
        public static void InitialiseTests(TestContext test)
        {
            string rootpath = (AppDomain.CurrentDomain.BaseDirectory ?? Environment.CurrentDirectory) + @"\\..\\..\\..\\..\\";

            bool recreateSchema = DPOContext.GenerateSQLCEedmx(rootpath, @"DPO.Tests\\DPO.Tests\\Context\\DPOContextTest.edmx");

            // file path of the database to create
            var dbTestFilePath = TestDatabasePath();

            if (recreateSchema)
            {
                throw new Exception("New Edmx Test file found and copied. Please publish the new database and compile code");
            }

            var context = TestAdmin.TestContext();

            //new SystemServices().SeedSystemDataDefaults();

            // new SystemTestDataServices().SeedSystemTestData();
        }