This repository has been archived by the owner on Dec 21, 2024. It is now read-only.
-
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.
Merge pull request #34 from StrangeRanger/dev
Major refactoring for underlining modularity and performance
- Loading branch information
Showing
15 changed files
with
403 additions
and
220 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Figma Demo | ||
|
||
This contains pictures/screenshots of the pre-coding design and demo of the application. Its purpose was to create a concept for what the gui might and should look like. |
This file was deleted.
Oops, something went wrong.
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,66 @@ | ||
using FAFB_PowerShell_Tool.PowerShell; | ||
|
||
namespace FAFB_PowerShell_Tool.Tests; | ||
|
||
[TestClass] | ||
public class GuiCommandTest | ||
{ | ||
[TestMethod] | ||
public void CommandNameIsCorrect() | ||
{ | ||
InternalCommand internalCommand = new("Get-ADUser"); | ||
Assert.AreEqual("Get-ADUser", internalCommand.CommandName); | ||
} | ||
|
||
[TestMethod] | ||
public void CommandNameThrowsArgumentExceptionWhenNull() | ||
{ | ||
Assert.ThrowsException<ArgumentException>(() => new GuiCommand(null!)); | ||
} | ||
|
||
[TestMethod] | ||
public void CommandNameThrowsArgumentExceptionWhenWhitespace() | ||
{ | ||
Assert.ThrowsException<ArgumentException>(() => new GuiCommand("")); | ||
Assert.ThrowsException<ArgumentException>(() => new GuiCommand(" ")); | ||
Assert.ThrowsException<ArgumentException>(() => new GuiCommand(string.Empty)); | ||
} | ||
|
||
[TestMethod] | ||
public void PossibleParametersThrowsInvalidOperationExceptionWhenEmpty() | ||
{ | ||
GuiCommand guiCommand = new("Get-ADUser"); | ||
Assert.ThrowsException<InvalidOperationException>(() => guiCommand.PossibleParameters); | ||
} | ||
|
||
[TestMethod] | ||
public void PossibleParametersReturnsCorrectly() | ||
{ | ||
GuiCommand guiCommand = new("Get-ADUser"); | ||
guiCommand.LoadCommandParametersAsync().Wait(); | ||
Assert.IsTrue(guiCommand.PossibleParameters.Contains("-Identity")); | ||
Assert.IsTrue(guiCommand.PossibleParameters.Count > 0); | ||
} | ||
|
||
[TestMethod] | ||
public void PossibleParametersReturnsCorrectlyWhenCalledTwice() | ||
{ | ||
GuiCommand guiCommand = new("Get-ADUser"); | ||
guiCommand.LoadCommandParametersAsync().Wait(); | ||
guiCommand.LoadCommandParametersAsync().Wait(); | ||
Assert.IsTrue(guiCommand.PossibleParameters.Contains("-Identity")); | ||
Assert.IsTrue(guiCommand.PossibleParameters.Count > 0); | ||
Assert.AreEqual(guiCommand.PossibleParameters.Count, guiCommand.PossibleParameters.Distinct().Count()); | ||
} | ||
|
||
[TestMethod] | ||
public void TestParameters() | ||
{ | ||
GuiCommand guiCommand = new("Get-ADUser") | ||
{ | ||
Parameters = new[] {"-Identity", "FAFB-Admin"} | ||
}; | ||
Assert.AreEqual(guiCommand.Parameters[0], "-Identity"); | ||
Assert.AreEqual(guiCommand.Parameters[1], "FAFB-Admin"); | ||
} | ||
} |
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
Oops, something went wrong.