-
-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathWrapperElementsGeneratorTest.cs
More file actions
36 lines (31 loc) · 1 KB
/
WrapperElementsGeneratorTest.cs
File metadata and controls
36 lines (31 loc) · 1 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
using AngleSharp;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using System.Reflection;
namespace Bunit.Web.AngleSharp;
public class WrapperElementsGeneratorTest
{
[Fact]
public Task Generator()
{
var inputCompilation = CreateCompilation();
var generator = new WrapperElementsGenerator();
GeneratorDriver driver = CSharpGeneratorDriver.Create(generator);
driver = driver.RunGenerators(inputCompilation, Xunit.TestContext.Current.CancellationToken);
var settings = new VerifySettings();
settings.AutoVerify();
return Verify(driver.GetRunResult(), settings);
}
private static Compilation CreateCompilation()
{
return CSharpCompilation.Create(
assemblyName: "compilation",
syntaxTrees: null,
references: new[]
{
MetadataReference.CreateFromFile(typeof(Binder).GetTypeInfo().Assembly.Location),
MetadataReference.CreateFromFile(typeof(BrowsingContext).Assembly.Location),
},
options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
}
}