public void Discover_returns_configuration() { var modelBuilder = new DbModelBuilder(); modelBuilder.Entity<Entity>().Property(e => e.Name).IsRequired(); var model = modelBuilder.Build(new DbProviderInfo("System.Data.SqlClient", "2012")); var entityType = model.ConceptualModel.EntityTypes.First(); var property = entityType.Properties.First(p => p.Name == "Name"); var configuration = new RequiredDiscoverer().Discover(property, model) as RequiredConfiguration; Assert.NotNull(configuration); }
public void Discover_returns_configuration() { var modelBuilder = new DbModelBuilder(); modelBuilder.Entity <Entity>().Property(e => e.Name).IsRequired(); var model = modelBuilder.Build(new DbProviderInfo("System.Data.SqlClient", "2012")); var entityType = model.ConceptualModel.EntityTypes.First(); var property = entityType.Properties.First(p => p.Name == "Name"); var configuration = new RequiredDiscoverer().Discover(property, model) as RequiredConfiguration; Assert.NotNull(configuration); }