Skip to content

Commit

Permalink
Changed test so that it's more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
twoody0 committed Dec 13, 2024
1 parent 891b3aa commit bbfef8c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Assignment.Tests/PingProcessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public void RunTaskAsync_Success()
AssertValidPingOutput(result);
Assert.AreEqual(0, result.ExitCode);
Assert.IsFalse(string.IsNullOrWhiteSpace(result.StdOutput));

// Do NOT use async/await in this test.
// Test Sut.RunTaskAsync("localhost");
}

[TestMethod]
Expand All @@ -63,8 +60,9 @@ public void RunAsync_UsingTaskReturn_Success()
PingResult result = default;

// Act
Task task = Sut.RunAsync("localhost -c 4").ContinueWith(t => result = t.Result);
Task<PingResult> task = Sut.RunAsync("localhost -c 4");
task.Wait();
result = task.Result;

// Assert
AssertValidPingOutput(result);
Expand Down

0 comments on commit bbfef8c

Please sign in to comment.