Add attributes to namespaces

Fix builders with empty attributes
This commit is contained in:
2024-04-10 15:15:47 +02:00
parent 975ab883fd
commit df191bf053
8 changed files with 89 additions and 49 deletions
+4 -1
View File
@@ -8,7 +8,8 @@ namespace Sybil.IntegrationTests;
public sealed class FlowTests
{
private const string ExpectedNamespace =
@"namespace TestNamespace
@"[InternalsVisibleTo(""FlowTests"")]
namespace TestNamespace
{
using System;
@@ -38,6 +39,8 @@ public sealed class FlowTests
public void NewNamespace_GeneratesExpected()
{
var namespaceSyntax = SyntaxBuilder.CreateNamespace("TestNamespace")
.WithAttribute(SyntaxBuilder.CreateAttribute("InternalsVisibleTo")
.WithArgument("FlowTests"))
.WithUsing("System")
.WithClass(
SyntaxBuilder.CreateClass("TestClass")