Пример #1
0
        public static TestClass BuildFrom(ClangWrapper clangWrapper, CXCursor classCursor)
        {
            var path        = clangWrapper.GetCursorFilePath(classCursor);
            var name        = clangWrapper.GetCursorName(classCursor);
            var line        = clangWrapper.GetCursorLine(classCursor);
            var testMethods = clangWrapper.RetrieveTestMethodsIn(classCursor);

            if (testMethods.Any())
            {
                return(new TestClass(path, name, line, new TestMethods(testMethods)));
            }

            return(new Class());
        }
Пример #2
0
        public static TestMethod BuildFrom(ClangWrapper clangWrapper, CXCursor methodCursor)
        {
            var path           = clangWrapper.GetCursorFilePath(methodCursor);
            var name           = clangWrapper.GetCursorName(methodCursor);
            var line           = clangWrapper.GetCursorLine(methodCursor);
            var testProperties = clangWrapper.RetrieveTestPropertiesIn(methodCursor);

            if (testProperties.Any())
            {
                return(new TestMethod(path, name, line, new TestProperties(testProperties)));
            }

            return(new Method());
        }
Пример #3
0
 public void retrieve_the_filepath_for_the_file_a_cursor_is_in()
 {
     ClangWrapper.GetCursorFilePath(ClassCursor).Should().Be(FilePath);
 }