Esempio n. 1
0
        public static void InitializeAssembly(TestContext ctx)
        {
            var db = new TempDb();

            db.Create();
            db.EnableClr(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
        }
Esempio n. 2
0
        public void CreatesDbDuringConstruction()
        {
            var mock = new MockDatabase();

            // ReSharper disable once UnusedVariable
            var tempDb = new TempDb(mock);

            Assert.True(mock.CreateCalled);
            Assert.False(mock.DropCalled);
        }
Esempio n. 3
0
        public void DropsDatabaseWhenDisposed()
        {
            var mock = new MockDatabase();
            var db   = new TempDb(mock);

            Assert.True(mock.CreateCalled);
            Assert.False(mock.DropCalled);

            db.Dispose();

            Assert.True(mock.DropCalled);
        }
Esempio n. 4
0
        public void OnGetAsync()
        {
            var tempDb = HttpContext.Session.GetObject <TempDb>("TempDb");

            if (tempDb == null)
            {
                tempDb         = new TempDb();
                tempDb.urlList = new List <ShortenedUrl>();
                HttpContext.Session.SetObject("TempDb", tempDb);
            }

            TemporaryList = tempDb.urlList;
        }
Esempio n. 5
0
        public static void AssemblyCleanup()
        {
            var db = new TempDb();

            db.Delete();
        }
        public static void MyClassCleanup()
        {
            TempDb tempDb = new TempDb();

            tempDb.DeleteStoredProcedure("sp_SomeSp");
        }
        public static void MyClassInitialize(TestContext testContext)
        {
            TempDb tempDb = new TempDb();

            tempDb.CopyStoredProcedure("sp_SomeSp");
        }