-
-
Notifications
You must be signed in to change notification settings - Fork 459
Expand file tree
/
Copy pathEmitterNamespaceTests.cs
More file actions
35 lines (28 loc) · 1.06 KB
/
EmitterNamespaceTests.cs
File metadata and controls
35 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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);
}
}