예제 #1
0
        public void CreateDatabaseTest()
        {
            //ARRANGE
            var fullPath   = String.Format(@"{0}\{1}", _testDir, DbFilename);
            var controller = new SqlCompactController();

            //ACT
            controller.CreateDb(fullPath);

            //ASSERT
            Assert.IsTrue(Directory.EnumerateFiles(_testDir).Any(f => f.Equals(fullPath)));
        }
예제 #2
0
        public void DeleteDatabaseTest()
        {
            //Arrange
            var fullPath   = String.Format(@"{0}\{1}", _testDir, DbFilename);
            var controller = new SqlCompactController();

            controller.CreateDb(fullPath);

            //Act
            controller.DeleteDb(fullPath);

            //Assert
            Assert.IsTrue(!dInfo.EnumerateFiles().Any());
        }
예제 #3
0
        public void Setup()
        {
            if (dInfo.Exists)
            {
                dInfo.Empty();
            }
            Directory.CreateDirectory(_mp3Dir);
            FileIO.WriteToFile(Mp3FullPath, TestsCommon.Properties.Resources.FileMp3);

            connString         = dBcontroller.CreateDb(DbFullPath);
            dbContext          = new RecordCaseContextForTests(connString, RecordCaseContextSeeder.GetSeeder());
            unitOfWork         = new UnitOfWork(dbContext, true);
            businessContext    = new BusinessContext(unitOfWork);
            collectionsContext = new CollectionsContext(CollectionsFullPath);
        }