Esempio n. 1
0
        public void search_for_soft_deleted_entities()
        {
            var e1 = new SoftDeletedEntity {
                Name = "Jeremy"
            };
            var e2 = new SoftDeletedEntity {
                Name = "Josh"
            };
            var e3 = new SoftDeletedEntity {
                Name = "Lindsey"
            };
            var e4 = new SoftDeletedEntity {
                Name = "Max"
            };

            thePersistor.Persist(e1);
            thePersistor.Persist(e2);
            thePersistor.Persist(e3);
            thePersistor.Persist(e4);

            theRepository.Remove(e3);


            e3.Deleted.ShouldNotBeNull();

            theRepository.Find <SoftDeletedEntity>(e3.Id).ShouldBeTheSameAs(e3);

            theRepository.All <SoftDeletedEntity>().ShouldHaveTheSameElementsAs(e1, e2, e4);
        }
        public void search_for_soft_deleted_entities()
        {
            var e1 = new SoftDeletedEntity {Name = "Jeremy"};
            var e2 = new SoftDeletedEntity {Name = "Josh"};
            var e3 = new SoftDeletedEntity {Name = "Lindsey"};
            var e4 = new SoftDeletedEntity {Name = "Max"};

            thePersistor.Persist(e1);
            thePersistor.Persist(e2);
            thePersistor.Persist(e3);
            thePersistor.Persist(e4);

            theRepository.Remove(e3);

            e3.Deleted.ShouldNotBeNull();

            theRepository.Find<SoftDeletedEntity>(e3.Id).ShouldBeTheSameAs(e3);

            theRepository.All<SoftDeletedEntity>().ShouldHaveTheSameElementsAs(e1, e2, e4);
        }