public void Can_generate_delete_tree_when_enum_key() { DbModel model; using (var context = new EnumKeyContext()) { model = context .InternalContext .CodeFirstModel .CachedModelBuilder .BuildDynamicUpdateModel(ProviderRegistry.Sql2008_ProviderInfo); } var commandTreeGenerator = new ModificationCommandTreeGenerator(model); var commandTrees = commandTreeGenerator .GenerateDelete(GetType().Namespace + ".EnumKey") .ToList(); Assert.Equal(1, commandTrees.Count()); }