public static void TestTryCombine([PexAssumeUnderTest] StatementLoopOverSortedPairValue target, IStatement statement) { var canComb = target.TryCombineStatement(statement, null); Assert.IsNotNull(statement, "Second statement null should cause a failure"); var allSame = target.CodeItUp().Zip(statement.CodeItUp(), (f, s) => f == s).All(t => t); Assert.IsTrue(allSame == canComb || target.Statements.Count() == 0, "not expected combination!"); }
public StatementLoopOverSortedPairValue RenameVariableTest([PexAssumeUnderTest] StatementLoopOverSortedPairValue target, string origin, string final) { target.RenameVariable(origin, final); var finder = new Regex(string.Format("\b{0}\b", origin)); var hasit = target.CodeItUp().Where(s => finder.IsMatch(s)).Any(); Assert.IsFalse(hasit, "found some code that contained the original guy"); return target; }
public string[] CodeItUpTest([PexAssumeUnderTest] StatementLoopOverSortedPairValue target) { var actual = target.CodeItUp().ToArray(); return actual; }