-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a7d89b
commit 383f25a
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/Silk.NET.SilkTouch.Emitter.Tests/EmitterNamespaceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Collections.Immutable; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CSharp; | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
using Silk.NET.SilkTouch.Symbols; | ||
using Xunit; | ||
|
||
namespace Silk.NET.SilkTouch.Emitter.Tests; | ||
|
||
public class EmitterNamespaceTests : EmitterTest | ||
{ | ||
[Fact] | ||
public void NamespaceIntegration() | ||
{ | ||
var syntax = Transform(new NamespaceSymbol(new IdentifierSymbol("Test"), ImmutableArray<TypeSymbol>.Empty)); | ||
|
||
var result = syntax.ToFullString(); | ||
Assert.Equal("namespace Test\n{\n}", result); | ||
} | ||
|
||
[Fact] | ||
public void NamespaceHasCorrectIdentifier() | ||
{ | ||
var syntax = Transform | ||
(new NamespaceSymbol(new IdentifierSymbol("Test"), ImmutableArray<TypeSymbol>.Empty)) as | ||
NamespaceDeclarationSyntax; | ||
|
||
Assert.NotNull(syntax); | ||
|
||
Assert.Equal("Test", Assert.IsType<IdentifierNameSyntax>(syntax!.Name).Identifier.Text); | ||
} | ||
} |