public void CanBeAssignedToTestCase() { test2.RemoveCombination(combi4); CombinationManager man3 = new CombinationManager(combi3); Assert.IsFalse(man3.CanBeAssignedToTestCase(test1)); CombinationManager man5 = new CombinationManager(combi5); Assert.IsTrue(man5.CanBeAssignedToTestCase(test1)); CombinationManager man4 = new CombinationManager(combi4); //combination already assigned Assert.IsFalse(man4.CanBeAssignedToTestCase(test1)); //child combination Assert.IsFalse(man4.CanBeAssignedToTestCase(test2)); //compatible combination combi5.AddEquivalenceClass(eq13); combi5.AddEquivalenceClass(eq23); combi5.AddEquivalenceClass(eq31); Assert.IsTrue(man5.CanBeAssignedToTestCase(test2)); //incompatible combination combi5.RemoveEquivalenceClass(eq23); combi5.AddEquivalenceClass(eq21); Assert.IsFalse(man5.CanBeAssignedToTestCase(test2)); }
public void ICombinationsBean() { TestCase tc = new TestCase(to.TestCasesStruct); DefaultDAO dao = new DefaultDAO(to.TestCasesStruct); Dependency dep = new Dependency(to.TestCasesStruct); Combination comb = new Combination(dep); tc.AddCombination(comb); dao.Save(); Assert.IsNotNull(dao.GetItem(tc.GetType(), tc.Id)); Assert.IsNotNull(dao.GetItem(comb.GetType(), comb.Id)); tc.RemoveCombination(comb); dep.RemoveCombination(comb); dao.DeleteItem(comb); to.TestCasesStruct.RemoveTestCase(tc); dao.DeleteItem(tc); to.TestCasesStruct.RemoveDependency(dep); dao.DeleteItem(dep); }
public void EqualsByRelationsTest() { TestCase tc1 = new TestCase(structure); TestCase tc2 = new TestCase(structure); tc1.Combinations.Add(combi2); tc1.Combinations.Add(combi3); tc1.EquivalenceClasses.Add(eq13); tc1.EquivalenceClasses.Add(eq22); tc2.Combinations.Add(combi2); tc2.Combinations.Add(combi3); tc2.EquivalenceClasses.Add(eq13); tc2.EquivalenceClasses.Add(eq22); Assert.IsTrue(tc1.EqualsByRelations(tc2)); tc1.RemoveCombination(combi3); Assert.IsFalse(tc1.EqualsByRelations(tc2)); }