Skip to content

Commit 7fcb33d

Browse files
PR feedback
1 parent 2552098 commit 7fcb33d

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/ProjectTemplates/test/GrpcTemplateTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task GrpcTemplate()
4444
using (var clientProcess = Project.StartBuiltClientAsync(serverProcess))
4545
{
4646
// Wait for the client to do its thing
47-
System.Threading.Thread.Sleep(100);
47+
await Task.Delay(100)
4848
Assert.False(
4949
clientProcess.Process.HasExited,
5050
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built client", Project, clientProcess.Process));
@@ -60,7 +60,7 @@ public async Task GrpcTemplate()
6060
using (var clientProcess = Project.StartPublishedClientAsync())
6161
{
6262
// Wait for the client to do its thing
63-
System.Threading.Thread.Sleep(100);
63+
await Task.Delay(100)
6464
Assert.False(
6565
clientProcess.Process.HasExited,
6666
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built client", Project, clientProcess.Process));

src/ProjectTemplates/test/Helpers/AspNetProcess.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public AspNetProcess(
3434
string workingDirectory,
3535
string dllPath,
3636
IDictionary<string, string> environmentVariables,
37-
bool useExec = true,
37+
bool published = true,
3838
bool hasListeningUri = true)
3939
{
4040
_output = output;
@@ -54,7 +54,7 @@ public AspNetProcess(
5454

5555
output.WriteLine("Running ASP.NET application...");
5656

57-
var arguments = useExec ? $"exec {dllPath}" : "run";
57+
var arguments = published ? $"exec {dllPath}" : "run";
5858
Process = ProcessEx.Run(output, workingDirectory, DotNetMuxer.MuxerPathOrDefault(), arguments, envVars: environmentVariables);
5959
if(hasListeningUri)
6060
{
@@ -216,7 +216,7 @@ public override string ToString()
216216
{
217217
if (!Process.HasExited)
218218
{
219-
result += $"(Listening on {_listeningUri.OriginalString}) PID: {Process.Id}";
219+
result += $"(Listening on {ListeningUri.OriginalString}) PID: {Process.Id}";
220220
}
221221
else
222222
{

src/ProjectTemplates/test/Helpers/Project.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ namespace Templates.Test.Helpers
1919
[DebuggerDisplay("{ToString(),nq}")]
2020
public class Project
2121
{
22+
private const string _urls = "http://127.0.0.1:0;https://127.0.0.1:0";
23+
2224
public const string DefaultFramework = "netcoreapp3.0";
2325

2426
public SemaphoreSlim DotNetNewLock { get; set; }
@@ -141,7 +143,7 @@ internal AspNetProcess StartBuiltServerAsync()
141143
};
142144

143145
var projectDll = Path.Combine(TemplateServerDir, $"{ProjectName}.Server.dll");
144-
return new AspNetProcess(Output, TemplateServerDir, projectDll, environment, useExec: false);
146+
return new AspNetProcess(Output, TemplateServerDir, projectDll, environment, published: false);
145147
}
146148

147149
internal AspNetProcess StartBuiltClientAsync(AspNetProcess serverProcess)
@@ -177,8 +179,6 @@ internal AspNetProcess StartPublishedClientAsync()
177179
return new AspNetProcess(Output, TemplateClientReleaseDir, projectDll, environment);
178180
}
179181

180-
private const string _urls = "http://127.0.0.1:0;https://127.0.0.1:0";
181-
182182
internal AspNetProcess StartBuiltProjectAsync()
183183
{
184184
var environment = new Dictionary<string, string>

src/ProjectTemplates/test/RazorPagesTemplateTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public RazorPagesTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputH
2424

2525
public ITestOutputHelper Output { get; }
2626

27-
2827
[Fact]
2928
public async Task RazorPagesTemplate_NoAuthImplAsync()
3029
{

0 commit comments

Comments
 (0)