Пример #1
0
        public void Instance_Implement_Interface_IDesignTimeDbContextFactory_Of_BlogDbContext()
        {
            var type = typeof(IDesignTimeDbContextFactory <BlogDbContext>);

            var factory = new DesignTimeBlogDbContextFactory();

            Assert.IsAssignableFrom(type, factory);
        }
Пример #2
0
        public void CreateDbContext_Return_BlogDbContext()
        {
            Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");

            var factory = new DesignTimeBlogDbContextFactory();

            var ctx = factory.CreateDbContext(args: new [] { "" });

            Assert.IsAssignableFrom <BlogDbContext>(ctx);

            Assert.NotNull(ctx);
        }