示例#1
0
        public StatementLoopOverGroups Constructor(IValue va)
        {
            var v = new StatementLoopOverGroups(va);

            Assert.IsNotNull(v.IndexVariable, "index variable");
            return(v);
        }
示例#2
0
        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!");
        }
示例#3
0
        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);
        }
示例#4
0
        public string[] CodeItUpTest([PexAssumeUnderTest] StatementLoopOverGroups target)
        {
            var actual = target.CodeItUp().ToArray();

            return(actual);
        }