public void TestTryCombinedFail()
        {
            var indiciesToInspect = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(int));
            var index1 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
            var index2 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
            var passedArray = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(bool));
            var s1 = new StatementCheckLoopPairwise(indiciesToInspect, index1, index2, passedArray);

            var indiciesToInspect1 = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(int));
            var index3 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
            var index4 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
            var passedArray1 = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(bool));
            var s2 = new StatementCheckLoopPairwise(indiciesToInspect1, index3, index4, passedArray1);

            Assert.IsFalse(s1.TryCombineStatement(s2, null), "COmbine should fail");
        }
        public void TestTryCombineGood()
        {
            var indiciesToInspect = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(int));
            var index1 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
            var index2 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
            var passedArray = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(bool));
            var s1 = new StatementCheckLoopPairwise(indiciesToInspect, index1, index2, passedArray);

            var index3 = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(int));
            var index4 = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(int));
            var passedArray1 = DeclarableParameter.CreateDeclarableParameterArrayExpression(typeof(bool));
            var s2 = new StatementCheckLoopPairwise(indiciesToInspect, index3, index4, passedArray1);
            s2.Add(new StatementSimpleStatement(string.Format("{0} = dude", index3.RawValue)));

            var co = new DoRenames(s2);
            Assert.IsTrue(s1.TryCombineStatement(s2, co), "COmbine should pass");
            Assert.AreEqual(1, s1.Statements.Count(), "# of statements");
            Assert.AreEqual(string.Format("{0} = dude", index1.RawValue), (s1.Statements.First() as StatementSimpleStatement).Line, "statement not translated");
        }