public void GetSubSet() { var builder = new SimpleExprBuilder(true); var dummyV = SymbooglixLibTests.MapProxyTests.GetVariable("dummy", BPLType.Int); // Hack dummyV.SetMetadata((int)Symbooglix.Annotation.AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(dummyV)); var v = new SymbolicVariable("foo", dummyV); var id = builder.Identifier(v); var c0 = new Constraint(builder.Gt(id, builder.ConstantInt(0))); var c1 = new Constraint(builder.Lt(id, builder.ConstantInt(10))); var CM0 = new ConstraintManager(); var CMSubset = new ConstraintManager(); CM0.AddConstraint(c0); CM0.AddConstraint(c1); CMSubset.AddConstraint(c1); var getSubset = CM0.GetSubSet(new HashSet <Constraint>() { c1 }); // Check they are the same Assert.AreEqual(1, getSubset.Count); Assert.AreEqual(1, CMSubset.Count); Assert.AreEqual(CMSubset.GetHashCode(), getSubset.GetHashCode()); Assert.IsTrue(CMSubset.Equals(getSubset)); }