Пример #1
0
 public void Sets_are_initialized_using_name_constructor_on_DbContext()
 {
     using (var context = new SimpleModelContext(DefaultDbName<SimpleModelContext>()))
     {
         Assert.NotNull(context.Products);
         Assert.NotNull(context.Categories);
         context.Assert<Product>().IsInModel();
         context.Assert<Category>().IsInModel();
     }
 }
Пример #2
0
 public void Sets_are_initialized_using_existing_connection_constructor_on_DbContext()
 {
     using (var connection = SimpleConnection<SimpleModelContext>())
     {
         using (var context = new SimpleModelContext(connection))
         {
             Assert.NotNull(context.Products);
             Assert.NotNull(context.Categories);
             context.Assert<Product>().IsInModel();
             context.Assert<Category>().IsInModel();
         }
     }
 }
Пример #3
0
 public void Sets_are_initialized_using_object_context_constructor_on_DbContext()
 {
     using (var context = new SimpleModelContext())
     {
         using (var context2 = new SimpleModelContext(GetObjectContext(context)))
         {
             Assert.NotNull(context2.Products);
             Assert.NotNull(context2.Categories);
             context.Assert<Product>().IsInModel();
             context.Assert<Category>().IsInModel();
         }
     }
 }