From 2b4def32e29fb5ffd212227b57d111d4ef1158bd Mon Sep 17 00:00:00 2001 From: SimonCropp Date: Tue, 31 Mar 2020 07:27:33 +1100 Subject: [PATCH] use some async overloads --- test/E2ETest/TyeGenerateTests.cs | 20 ++++++++++---------- test/E2ETest/TyeRunTests.cs | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/E2ETest/TyeGenerateTests.cs b/test/E2ETest/TyeGenerateTests.cs index ccee82f4..5eaa541a 100644 --- a/test/E2ETest/TyeGenerateTests.cs +++ b/test/E2ETest/TyeGenerateTests.cs @@ -48,8 +48,8 @@ namespace E2ETest 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"); @@ -87,8 +87,8 @@ namespace E2ETest 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()); @@ -130,8 +130,8 @@ namespace E2ETest 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()); @@ -170,8 +170,8 @@ namespace E2ETest 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()); @@ -205,8 +205,8 @@ namespace E2ETest 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()); diff --git a/test/E2ETest/TyeRunTests.cs b/test/E2ETest/TyeRunTests.cs index 1355b5ef..b09450bd 100644 --- a/test/E2ETest/TyeRunTests.cs +++ b/test/E2ETest/TyeRunTests.cs @@ -264,7 +264,7 @@ namespace E2ETest 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" };