public StatementLoopOverGroups RenameVariableTest([PexAssumeUnderTest] StatementLoopOverGroups 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 static void TestTryCombine([PexAssumeUnderTest] StatementLoopOverGroups 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.AreEqual(allSame, canComb, "not expected combination!"); }
public string[] CodeItUpTest([PexAssumeUnderTest] StatementLoopOverGroups target) { var actual = target.CodeItUp().ToArray(); return(actual); }