-
-
Notifications
You must be signed in to change notification settings - Fork 458
Expand file tree
/
Copy pathNamespaceTests.cs
More file actions
47 lines (37 loc) · 1.3 KB
/
NamespaceTests.cs
File metadata and controls
47 lines (37 loc) · 1.3 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
36
37
38
39
40
41
42
43
44
45
46
47
// 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 Moq;
using Moq.Protected;
using Xunit;
namespace Silk.NET.SilkTouch.Symbols.Tests.SymbolVisitorTests;
public class NamespaceTests
{
[Fact]
public void NamespaceIdentifierIsVisited()
{
var symbol = new NamespaceSymbol(new IdentifierSymbol(""), ImmutableArray<TypeSymbol>.Empty);
var visitor = new Mock<SymbolVisitor>
{
CallBase = true
};
visitor.Object.Visit(symbol);
visitor.Protected()
.Verify<IdentifierSymbol>("VisitIdentifier", Times.Once(), ItExpr.IsAny<IdentifierSymbol>());
}
[Fact]
public void NamespaceMemberIsVisited()
{
var symbol = new NamespaceSymbol(new IdentifierSymbol(""), new []
{
(TypeSymbol)new StructSymbol(new IdentifierSymbol(""), StructLayout.Empty)
}.ToImmutableArray());
var visitor = new Mock<SymbolVisitor>
{
CallBase = true
};
visitor.Object.Visit(symbol);
visitor.Protected()
.Verify<StructSymbol>("VisitStruct", Times.Once(), ItExpr.IsAny<StructSymbol>());
}
}