Exemplo n.º 1
0
        public void FixFieldsSpace()
        {
            var    stuff   = "List<Monster> monsterlist;";
            string fixSnip = CodeSearchResultInstance.SourceToSnippet(stuff, CodeSearchResult.DefaultSnippetSize);

            Assert.IsTrue(fixSnip.Equals("List<Monster> monsterlist;\n"));
        }
Exemplo n.º 2
0
        public void FixSnipSpacesTest()
        {
            var stuff = "      public void yo()" +
                        "\n            sasdfsadf" +
                        "\n            asdfasdf\n" +
                        "      }";
            string fixSnip = CodeSearchResultInstance.SourceToSnippet(stuff, CodeSearchResult.DefaultSnippetSize);

            Assert.IsTrue(fixSnip.Equals("public void yo()\n      sasdfsadf\n      asdfasdf\n}\n"));
        }
Exemplo n.º 3
0
        public void FixNoSpaceOnFirst()
        {
            var stuff = "public void yo()" +
                        "\n\t{" +
                        "\n\t\tasdfasdf\n" +
                        "\t}";
            string fixSnip = CodeSearchResultInstance.SourceToSnippet(stuff, CodeSearchResult.DefaultSnippetSize);

            Assert.IsTrue(fixSnip.Equals("public void yo()\n{\n    asdfasdf\n}\n"));
        }
Exemplo n.º 4
0
        public void FixSpacesDifferentCase()
        {
            string fixSnip = CodeSearchResultInstance.SourceToSnippet(input, CodeSearchResult.DefaultSnippetSize);

            Assert.IsTrue(fixSnip.Equals("public virtual List<CodeSearchResult> Search(string searchString, bool rerunWithWildc...\n" +
                                         "{\n" +
                                         "    Contract.Requires(String.IsNullOrWhiteSpace(searchString), \"CodeSearcher:Search -...\n" +
                                         "    var searchCriteria = CriteriaBuilder.GetBuilder().AddSearchString(searchString).G...\n" +
                                         "}\n"
                                         ));
        }
Exemplo n.º 5
0
        public void FixAnotherWeirdCase()
        {
            string fixSnip = CodeSearchResultInstance.SourceToSnippet(tab, CodeSearchResult.DefaultSnippetSize);

            Assert.IsTrue(fixSnip.Equals("protected virtual void Layout(bool continueLayout)\r\n" +
                                         "{\r\n" +
                                         "    if (Graph == null || Graph.VertexCount == 0 || !LayoutAlgorithmFactory.IsValidAlg...\n" +
                                         "        return; //no graph to layout, or wrong layout algorithm\r\n" +
                                         "}\r\n"
                                         ));
        }