Ejemplo n.º 1
0
        public void ThatSubstanceCanBeDeletedWithoutDeletingSubstanceGroup()
        {
            var substance = SubstanceServices.WithDto(SubstanceTestFixtures.GetSubstanceWithGroup()).Get();
            var id        = substance.SubstanceGroup.Id;

            SubstanceServices.Delete(substance);
            var group = Context.CurrentSession().Get <SubstanceGroup>(id);

            Assert.IsNotNull(group);
        }
Ejemplo n.º 2
0
        public void ThatSubstanceCanBeDeletedWithinTransaction()
        {
            var substance = SubstanceServices.WithDto(SubstanceTestFixtures.GetSubstanceWithGroup()).Get();

            SubstanceServices.Delete(substance);

            substance =
                SubstanceServices.Substances.SingleOrDefault(
                    s => s.Name == SubstanceTestFixtures.GetSubstanceWithGroup().Name);
            Assert.IsNull(substance);
        }
Ejemplo n.º 3
0
        public void ThatSubstanceCanBeDeleted()
        {
            var substance = SubstanceServices.WithDto(SubstanceTestFixtures.GetSubstanceWithGroup()).Get();

            SubstanceServices.Delete(substance);
            Context.CurrentSession().Transaction.Commit();

            Context.CurrentSession().Transaction.Begin();
            substance =
                SubstanceServices.Substances.SingleOrDefault(
                    s => s.Name == SubstanceTestFixtures.GetSubstanceWithGroup().Name);
            Assert.IsNull(substance);
        }
Ejemplo n.º 4
0
        public void ThatIfSubstanceDeleteIsCalledSubstanceGroupHasNoAssociationWithSubstance()
        {
            var substance = SubstanceServices.WithDto(SubstanceTestFixtures.GetSubstanceWithGroup()).Get();

            SubstanceServices.Delete(substance);
        }