public void SkipViewsInMappingExtractor() { using (var ctx = new UnitTestContext()) { var extractor = new MappingsExtractor(ctx); var hasMappings = extractor.HasMappings(typeof(Contact)); Assert.IsFalse(hasMappings); } }
public void SchoolTableNames() { using (var ctx = new UnitTestContext()) { var timeout = ctx.Database.GetCommandTimeout(); var extractor = new MappingsExtractor(ctx); extractor.GetMappings(typeof(Course)); var tableName = extractor.GetTableName(ctx, typeof(Course)); Assert.AreEqual("dbo", tableName.Schema); Assert.AreEqual("Course", tableName.Name); tableName = extractor.GetTableName(ctx, typeof(Department)); Assert.AreEqual("dbo", tableName.Schema); Assert.AreEqual("Department", tableName.Name); tableName = extractor.GetTableName(ctx, typeof(Instructor)); Assert.AreEqual("dbo", tableName.Schema); Assert.AreEqual("Instructor", tableName.Name); tableName = extractor.GetTableName(ctx, typeof(OfficeAssignment)); Assert.AreEqual("dbo", tableName.Schema); Assert.AreEqual("OfficeAssignment", tableName.Name); } }