diff --git a/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/SrcInfoExportTest.cs b/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/SrcInfoExportTest.cs new file mode 100644 index 00000000000..c311b30fdb3 --- /dev/null +++ b/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/SrcInfoExportTest.cs @@ -0,0 +1,34 @@ +using System; +using System.IO; +using System.Linq; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Xunit; + +namespace commercetools.Api.IntegrationTests +{ + public class SrcInfoExportTest + { + [Fact] + public void test() + { + String programPath = @"/Users/jensschulze/workspace/commercetools-dotnet-sdk-v2/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/Categories/CategoriesIntegrationTests.cs"; + String programText = File.ReadAllText(programPath); + SyntaxTree programTree = CSharpSyntaxTree.ParseText(programText); + CompilationUnitSyntax root = programTree.GetCompilationUnitRoot(); + + + var methods = from methodDeclaration in root.DescendantNodes().OfType() + select ( + ((methodDeclaration.Parent as ClassDeclarationSyntax).Parent as NamespaceDeclarationSyntax).Name.ToFullString(), + (methodDeclaration.Parent as ClassDeclarationSyntax).Identifier.ToFullString(), + methodDeclaration.Identifier.ToFullString(), methodDeclaration.Body.Statements.ToFullString(), + methodDeclaration.GetLocation().GetMappedLineSpan().StartLinePosition.Line.ToString(), + methodDeclaration.GetLocation().GetMappedLineSpan().EndLinePosition.Line.ToString() + ); + + Console.WriteLine(string.Join("\n", methods)); + } + } +} \ No newline at end of file diff --git a/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/commercetools.Api.IntegrationTests.csproj b/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/commercetools.Api.IntegrationTests.csproj index 590d7b4773a..38b75d09295 100644 --- a/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/commercetools.Api.IntegrationTests.csproj +++ b/commercetools.Sdk/IntegrationTests/commercetools.Api.IntegrationTests/commercetools.Api.IntegrationTests.csproj @@ -8,6 +8,7 @@ +