Skip to content

Commit

Permalink
feat: <C#> add class int namespcae in namespcae support
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 14, 2020
1 parent 9cb7a37 commit 0e010e7
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ using System;
namespace HelloWorldApp {
class Geeks {
static void Main(string[] args) {
Console.WriteLine("Hello World!");
Console.ReadKey();
}
}
}
"""
Expand All @@ -101,4 +98,24 @@ namespace HelloWorldApp {
assertEquals(codeContainer.Containers[0].DataStructures.size, 1)
assertEquals(codeContainer.Containers[0].DataStructures[0].NodeName, "Geeks")
}

@Test
fun shouldIdentNameSpaceClassInNameSpaceName() {
val code = """
using System;
namespace HelloWorldApp {
class Geeks {}
namespace HelloWorldApp2 {
class Geeks2 {}
}
}
"""
val codeContainer = CSharpAnalyser().analysis(code, "hello.cs")
println(codeContainer.toString())
assertEquals(codeContainer.Containers[0].DataStructures.size, 1)
assertEquals(codeContainer.Containers[0].DataStructures[0].NodeName, "Geeks")
assertEquals(codeContainer.Containers[0].Containers[0].DataStructures.size, 1)
assertEquals(codeContainer.Containers[0].Containers[0].DataStructures[0].NodeName, "Geeks2")
}
}

0 comments on commit 0e010e7

Please # to comment.