Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
use some async overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored and rynowak committed Apr 1, 2020
1 parent 32a3c8e commit 2b4def3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions test/E2ETest/TyeGenerateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public async Task SingleProjectGenerateTest()
await GenerateHost.ExecuteGenerateAsync(outputContext, application, environment, interactive: false);

// name of application is the folder
var content = File.ReadAllText(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = File.ReadAllText($"testassets/generate/{projectName}.yaml");
var content = await File.ReadAllTextAsync(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = await File.ReadAllTextAsync($"testassets/generate/{projectName}.yaml");

Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());
await DockerAssert.AssertImageExistsAsync(output, "test/test-project");
Expand Down Expand Up @@ -87,8 +87,8 @@ public async Task FrontendBackendGenerateTest()
await GenerateHost.ExecuteGenerateAsync(outputContext, application, environment, interactive: false);

// name of application is the folder
var content = File.ReadAllText(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = File.ReadAllText($"testassets/generate/{projectName}.yaml");
var content = await File.ReadAllTextAsync(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = await File.ReadAllTextAsync($"testassets/generate/{projectName}.yaml");

Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());

Expand Down Expand Up @@ -130,8 +130,8 @@ public async Task MultipleProjectGenerateTest()
await GenerateHost.ExecuteGenerateAsync(outputContext, application, environment, interactive: false);

// name of application is the folder
var content = File.ReadAllText(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = File.ReadAllText($"testassets/generate/{projectName}.yaml");
var content = await File.ReadAllTextAsync(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = await File.ReadAllTextAsync($"testassets/generate/{projectName}.yaml");

Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());

Expand Down Expand Up @@ -170,8 +170,8 @@ public async Task GenerateWorksWithoutRegistry()
await GenerateHost.ExecuteGenerateAsync(outputContext, application, environment, interactive: false);

// name of application is the folder
var content = File.ReadAllText(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = File.ReadAllText($"testassets/generate/{projectName}-noregistry.yaml");
var content = await File.ReadAllTextAsync(Path.Combine(tempDirectory.DirectoryPath, $"{projectName}-generate-{environment}.yaml"));
var expectedContent = await File.ReadAllTextAsync($"testassets/generate/{projectName}-noregistry.yaml");

Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());

Expand Down Expand Up @@ -205,8 +205,8 @@ public async Task Generate_DaprApplication()
await GenerateHost.ExecuteGenerateAsync(outputContext, application, environment, interactive: false);

// name of application is the folder
var content = File.ReadAllText(Path.Combine(projectDirectory.DirectoryPath, $"{applicationName}-generate-{environment}.yaml"));
var expectedContent = File.ReadAllText($"testassets/generate/dapr.yaml");
var content = await File.ReadAllTextAsync(Path.Combine(projectDirectory.DirectoryPath, $"{applicationName}-generate-{environment}.yaml"));
var expectedContent = await File.ReadAllTextAsync($"testassets/generate/dapr.yaml");

Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());

Expand Down
2 changes: 1 addition & 1 deletion test/E2ETest/TyeRunTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public async Task DockerHostVolumeTest()
AllowAutoRedirect = false
};

File.WriteAllText(Path.Combine(tempDir.DirectoryPath, "file.txt"), "This content came from the host");
await File.WriteAllTextAsync(Path.Combine(tempDir.DirectoryPath, "file.txt"), "This content came from the host");

var client = new HttpClient(new RetryHandler(handler));
var args = new[] { "--docker" };
Expand Down

0 comments on commit 2b4def3

Please sign in to comment.