Пример #1
0
        public void LuceneDocToCustomProgramElementForMethod()
        {
            //test Create
            var document                         = MyCustomMethodElementForTesting.GetLuceneDocument();
            var customProgramElement             = ConverterFromHitToProgramElement.Create(document).Convert();
            var myCustomProgramElementForTesting = customProgramElement as MyCustomMethodElementForTesting;

            Assert.IsTrue(myCustomProgramElementForTesting != null);
            Assert.IsTrue(myCustomProgramElementForTesting.Boom.Equals("Ba dow"));
        }
Пример #2
0
        public void CustomDocumentToLuceneDocumentForMethod()
        {
            //test AddDocumentFields
            var customSandoDocument            = new MethodDocument(MyCustomMethodElementForTesting.GetMethodElement());
            var luceneDocumentWithCustomFields = customSandoDocument.GetDocument();

            Assert.IsTrue(luceneDocumentWithCustomFields != null);
            Assert.IsTrue(luceneDocumentWithCustomFields.GetField("Boom") != null);
            Assert.IsTrue(luceneDocumentWithCustomFields.GetField("Boom").StringValue().Equals("Ba dow"));
        }
Пример #3
0
        public static MethodElement GetMethodElement()
        {
            var methodElement = new MyCustomMethodElementForTesting("multiply", 12, -1000, "C:/Projects/SampleClass.cs",
                                                                    "private int multiply(int number, int factor)\n{\nreturn number * factor;\n};",
                                                                    AccessLevel.Public, "int number, int factor", "int",
                                                                    "return number * factor;", new Guid(),
                                                                    "SampleCLass", "", false);

            methodElement.Boom = "Ba dow";
            return(methodElement);
        }
Пример #4
0
 public static MethodElement GetMethodElement()
 {
     var methodElement = new MyCustomMethodElementForTesting("multiply", 12, -1000, "C:/Projects/SampleClass.cs",
                                         "private int multiply(int number, int factor)\n{\nreturn number * factor;\n};",
                                         AccessLevel.Public, "int number, int factor", "int",
                                         "return number * factor;", new Guid(),
                                                     "SampleCLass", "", false);
     methodElement.Boom = "Ba dow";
     return methodElement;
 }