-
Notifications
You must be signed in to change notification settings - Fork 488
/
Copy pathSourceGeneratorTests.cs
34 lines (31 loc) · 1.67 KB
/
SourceGeneratorTests.cs
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
namespace Amazon.Lambda.TestTool.Tests
{
public class SourceGeneratorTests
{
[Fact]
public void SourceGeneratorInputAndOutput()
{
var runConfiguration = new TestToolStartup.RunConfiguration
{
Mode = TestToolStartup.RunConfiguration.RunMode.Test,
OutputWriter = new StringWriter()
};
var buildPath = Path.GetFullPath($"../../../../LambdaFunctions/SourceGeneratorExample/bin/Debug/{TestUtils.GetTargetFramework()}");
TestToolStartup.Startup("Unit Tests", null, new string[] { "--path", buildPath, "--no-ui", "--payload", "{\"Name\" : \"FooBar\"}", "--config-file", "SourceGeneratorInputAndOutput.json" }, runConfiguration);
Assert.Contains("Response = FooBar", runConfiguration.OutputWriter.ToString());
}
[Fact]
public void SourceGeneratorAsyncInputOnly()
{
var runConfiguration = new TestToolStartup.RunConfiguration
{
Mode = TestToolStartup.RunConfiguration.RunMode.Test,
OutputWriter = new StringWriter()
};
var buildPath = Path.GetFullPath($"../../../../LambdaFunctions/SourceGeneratorExample/bin/Debug/{TestUtils.GetTargetFramework()}");
TestToolStartup.Startup("Unit Tests", null, new string[] { "--path", buildPath, "--no-ui", "--payload", "{\"Name\" : \"FooBar\"}", "--config-file", "SourceGeneratorAsyncInputOnly.json" }, runConfiguration);
Assert.Contains("Calling function with:", runConfiguration.OutputWriter.ToString());
Assert.DoesNotContain("Error:", runConfiguration.OutputWriter.ToString());
}
}
}