public void IEffectsBean() { Element elem = new Element(to.TestCasesStruct); EquivalenceClass equivalenceClass = new EquivalenceClass(elem); Effect effect = new Effect(to.TestCasesStruct); equivalenceClass.AddEffect(effect); DefaultDAO dao = new DefaultDAO(to.TestCasesStruct); dao.Save(); Assert.IsNotNull(dao.GetItem(elem.GetType(), elem.Id)); Assert.IsNotNull(dao.GetItem(equivalenceClass.GetType(), equivalenceClass.Id)); Assert.IsNotNull(dao.GetItem(effect.GetType(), effect.Id)); EquivalenceClass eq2 = dao.GetItem(equivalenceClass.GetType(), equivalenceClass.Id) as EquivalenceClass; #pragma warning disable PossibleNullReferenceException Assert.IsTrue(eq2.Effects.Contains(effect)); #pragma warning restore PossibleNullReferenceException }
public void IEquivalenceClassesBean() { TestCase tc = new TestCase(to.TestCasesStruct); DefaultDAO dao = new DefaultDAO(to.TestCasesStruct); Element elem = new Element(to.TestCasesStruct); EquivalenceClass equivalenceClass = new EquivalenceClass(elem); tc.AddEquivalenceClass(equivalenceClass); dao.Save(); Assert.IsNotNull(dao.GetItem(tc.GetType(), tc.Id)); Assert.IsNotNull(dao.GetItem(equivalenceClass.GetType(), equivalenceClass.Id)); tc.RemoveEquivalenceClass(equivalenceClass); elem.RemoveEquivalenceClass(equivalenceClass); dao.DeleteItem(equivalenceClass); to.TestCasesStruct.RemoveTestCase(tc); dao.DeleteItem(tc); to.TestCasesStruct.RemoveElement(elem); dao.DeleteItem(elem); }
public void IEquivalenceClassesBean() { // SessionManager.ReuseSession = false; Element elem = new Element(to.TestCasesStruct); DefaultDAO dao = new DefaultDAO(elem); EquivalenceClass equivalenceClass = new EquivalenceClass(elem); dao.AddNew(); Assert.IsNotNull(dao.GetItem(elem.GetType(), elem.Id)); Assert.IsNotNull(dao.GetItem(equivalenceClass.GetType(), equivalenceClass.Id)); Element elem2 = dao.GetItem(elem.GetType(), elem.Id) as Element; //dao.Activate(elem2,"EquivalenceClasses"); SessionManager.CurrentSession.Lock(elem2, LockMode.Read); #pragma warning disable PossibleNullReferenceException Assert.IsTrue(elem2.EquivalenceClasses.Contains(equivalenceClass)); #pragma warning restore PossibleNullReferenceException }