public void DbContextConstructor_Should_ReturnInstanceOfIt()
        {
            var dbContext = new CarAdvertsSystemDbContext();

            Assert.IsInstanceOf <ICarAdvertsSystemDbContext>(dbContext);
        }
        public void DbContextConstructor_Should_HaveParameterlessConstructor()
        {
            var dbContext = new CarAdvertsSystemDbContext();

            Assert.IsInstanceOf <CarAdvertsSystemDbContext>(dbContext);
        }
        public void DbContextCreate_Should_ReturnANewInstanceOfTheDbContext()
        {
            var context = CarAdvertsSystemDbContext.Create();

            Assert.IsNotNull(context);
        }
        public void DbContextCreate_Should_ReturnANewInstanceOfTheDbContextSecondCase()
        {
            var context = CarAdvertsSystemDbContext.Create();

            Assert.IsInstanceOf <ICarAdvertsSystemDbContext>(context);
        }
示例#5
0
 public static void Initialize()
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <CarAdvertsSystemDbContext, Configuration>());
     CarAdvertsSystemDbContext.Create().Database.Initialize(true);
 }