-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathSampleTest.cs
More file actions
37 lines (30 loc) · 772 Bytes
/
SampleTest.cs
File metadata and controls
37 lines (30 loc) · 772 Bytes
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
public class SampleTest
{
[Fact]
public Task Driver()
{
var driver = BuildDriver();
return Verify(driver);
}
[Fact]
public Task RunResults()
{
var driver = BuildDriver();
var results = driver.GetRunResult();
return Verify(results);
}
[Fact]
public Task RunResult()
{
var driver = BuildDriver();
var result = driver.GetRunResult().Results.Single();
return Verify(result);
}
static GeneratorDriver BuildDriver()
{
var compilation = CSharpCompilation.Create("name");
var generator = new HelloWorldGenerator();
var driver = CSharpGeneratorDriver.Create(generator);
return driver.RunGenerators(compilation);
}
}