-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/PackageReferenceVersionToAttributeToolTests/HelpTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// <copyright file="UsageTests.cs" company="Rami Abughazaleh"> | ||
// Copyright (c) Rami Abughazaleh. All rights reserved. | ||
// </copyright> | ||
|
||
namespace PackageReferenceVersionToAttributeToolTests | ||
{ | ||
using System.IO; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using PackageReferenceVersionToAttributeTool; | ||
using static PackageReferenceVersionToAttributeToolTests.ToolRunner.ToolRunner; | ||
|
||
/// <summary> | ||
/// Contains unit tests for verifying the expected behavior for the `--help` parameter of the tool. | ||
/// </summary> | ||
[TestClass] | ||
public class HelpTests | ||
{ | ||
/// <summary> | ||
/// Verifies that a call to <see cref="Program.Main"/> | ||
/// with the `--help` parameter, | ||
/// returns a successful exit code and displays the command line usage on the console. | ||
/// </summary> | ||
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> | ||
[TestMethod] | ||
public async Task Run_WithHelpParameter_DisplaysUsage() | ||
{ | ||
// Act | ||
var result = await RunToolAsync("--help"); | ||
|
||
// Assert | ||
Assert.AreEqual(0, result.ExitCode, result.OutputAndError); | ||
|
||
var expectedOutput = await File.ReadAllTextAsync("Usage.txt"); | ||
Assert.AreEqual(expectedOutput, result.Output.Trim(), result.OutputAndError); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters