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 branch 'Joseph-Refactor' into dev
- Loading branch information
Showing
11 changed files
with
309 additions
and
295 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections.ObjectModel; | ||
using System.Management.Automation.Runspaces; | ||
using ActiveDirectoryQuerier.PowerShell; | ||
|
||
namespace ActiveDirectoryQuerier.Tests; | ||
|
||
// ReSharper disable once InconsistentNaming | ||
public class ADCommandsFetcherTests | ||
{ | ||
[Fact] | ||
public async Task GetADCommands_ReturnsCommandList_IsNotEmpty() | ||
{ | ||
// Act | ||
ObservableCollection<Command> adCommands = await ADCommandsFetcher.GetADCommands(); | ||
|
||
// Assert | ||
Assert.NotEmpty(adCommands); | ||
} | ||
|
||
[Theory] | ||
[InlineData("Get-ADUser")] | ||
[InlineData("Get-ADGroup")] | ||
[InlineData("Get-ADComputer")] | ||
public async Task GetADCommands_ReturnsCommandList_ContainsCommand(string commandName) | ||
{ | ||
// Act | ||
ObservableCollection<Command> adCommands = await ADCommandsFetcher.GetADCommands(); | ||
|
||
// Assert | ||
Assert.Contains(adCommands, command => command.CommandText == commandName); | ||
} | ||
} |
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
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,39 @@ | ||
using ActiveDirectoryQuerier.PowerShell; | ||
|
||
namespace ActiveDirectoryQuerier.Tests; | ||
|
||
// ReSharper disable once InconsistentNaming | ||
public class PSOutputTest | ||
{ | ||
[Fact] | ||
public void HadErrors_StdErrHasEntries_ReturnsTrue() | ||
{ | ||
// Arrange | ||
PSOutput psOutput = new(); | ||
psOutput.StdErr.Add("Error"); | ||
|
||
// Act | ||
bool result = psOutput.HadErrors; | ||
|
||
// Assert | ||
Assert.True(result); | ||
Assert.NotEmpty(psOutput.StdErr); | ||
Assert.Empty(psOutput.StdOut); | ||
} | ||
|
||
[Fact] | ||
public void NoErrors_StdOutHasEntries_ReturnsFalse() | ||
{ | ||
// Arrange | ||
PSOutput psOutput = new(); | ||
psOutput.StdOut.Add("Output"); | ||
|
||
// Act | ||
var result = psOutput.HadErrors; | ||
|
||
// Assert | ||
Assert.False(result); | ||
Assert.Empty(psOutput.StdErr); | ||
Assert.NotEmpty(psOutput.StdOut); | ||
} | ||
} |
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
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.