public void MergeRequirementsMismatchedCase()
        {
            AssertUtil.AreEqual(
                PythonProjectNode.MergeRequirements(new[] {
                "aaaaaa==0.0",
                "BbBbBb==0.1",
                "CCCCCC==0.2"
            }, new[] {
                "aaaAAA==0.1",
                "bbbBBB==0.2",
                "cccCCC==0.3"
            }, false),
                "aaaAAA==0.1",
                "bbbBBB==0.2",
                "cccCCC==0.3"
                );

            // https://pytools.codeplex.com/workitem/2465
            AssertUtil.AreEqual(
                PythonProjectNode.MergeRequirements(new[] {
                "Flask==0.10.1",
                "itsdangerous==0.24",
                "Jinja2==2.7.3",
                "MarkupSafe==0.23",
                "Werkzeug==0.9.6"
            }, new[] {
                "flask==0.10.1",
                "itsdangerous==0.24",
                "jinja2==2.7.3",
                "markupsafe==0.23",
                "werkzeug==0.9.6"
            }, false),
                "flask==0.10.1",
                "itsdangerous==0.24",
                "jinja2==2.7.3",
                "markupsafe==0.23",
                "werkzeug==0.9.6"
                );
        }
        public void MergeRequirements()
        {
            // Comments should be preserved, only package specs should change.
            AssertUtil.AreEqual(
                PythonProjectNode.MergeRequirements(new[] {
                "a # with a comment",
                "B==0.2",
                "# just a comment B==01234",
                "",
                "x < 1",
                "d==1.0 e==2.0 f==3.0"
            }, new[] {
                "b==0.1",
                "a==0.2",
                "c==0.3",
                "e==4.0",
                "x==0.8"
            }, false),
                "a==0.2 # with a comment",
                "b==0.1",
                "# just a comment B==01234",
                "",
                "x==0.8",
                "d==1.0 e==4.0 f==3.0"
                );

            // addNew is true, so the c==0.3 should be added.
            AssertUtil.AreEqual(
                PythonProjectNode.MergeRequirements(new[] {
                "a # with a comment",
                "b==0.2",
                "# just a comment B==01234"
            }, new[] {
                "B==0.1",       // case is updated
                "a==0.2",
                "c==0.3"
            }, true),
                "a==0.2 # with a comment",
                "B==0.1",
                "# just a comment B==01234",
                "c==0.3"
                );

            // No existing entries, so the new ones are sorted and returned.
            AssertUtil.AreEqual(
                PythonProjectNode.MergeRequirements(null, new[] {
                "b==0.2",
                "a==0.1",
                "c==0.3"
            }, false),
                "a==0.1",
                "b==0.2",
                "c==0.3"
                );

            // Check all the inequalities
            const string inequalities = "<=|>=|<|>|!=|==";

            AssertUtil.AreEqual(
                PythonProjectNode.MergeRequirements(
                    inequalities.Split('|').Select(s => "a " + s + " 1.2.3"),
                    new[] { "a==0" },
                    false
                    ),
                inequalities.Split('|').Select(_ => "a==0").ToArray()
                );
        }