public void Delete_Does_Nothing()
 {
     // I realise this test has no asserts. I am making sure there are no
     // null pointer exceptions thrown.
     Entity entity = new EntityImpl();
     entity.DeleteSelf();
 }
        public void All_Its_References_Are_Deleted()
        {
            EntitySet entitySet = new EntitySetImpl();

            Entity entity1 = new EntityImpl("Table1");
            Entity entity2 = new EntityImpl("Table2");

            entitySet.AddEntity(entity1);
            entitySet.AddEntity(entity2);

            entity1.CreateReferenceTo(entity2);

            Assert.That(entity2.References.Count(), Is.EqualTo(1));
            Assert.That(entitySet.Entities.Count(), Is.EqualTo(2));

            entity1.DeleteSelf();

            Assert.That(entitySet.Entities.Count(), Is.EqualTo(1));
            Assert.That(entitySet.Entities.ElementAt(0), Is.SameAs(entity2));
            Assert.That(entity2.References.Count, Is.EqualTo(0));
        }