-
-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature Request: ShouldResult property (#2381)
* Feature Request: Expected, Actual, and Because as Test Property Fields Fixes #1993 * Add lingering "Be" because value * Add missing because argument * Add a strong type to ShouldResult * Fix issue with HaveCount having a typed ExpectedValue parameter * Update src/functions/assertions/Should.ps1 Co-authored-by: Frode Flaten <3436158+fflaten@users.noreply.github.com> * Refactor to guard clauses to ensure success records do not have additional properties * CreateShouldErrorRecord to object type * Add ExpectResult and strong typing to Should -Invoke * Remove null failuremessage --------- Co-authored-by: Frode Flaten <3436158+fflaten@users.noreply.github.com> Co-authored-by: Jakub Jareš <me@jakubjares.com>
- Loading branch information
1 parent
e90392a
commit fa6f0b2
Showing
26 changed files
with
398 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Pester | ||
{ | ||
public class ShouldResult | ||
{ | ||
public bool Succeeded { get; set; } | ||
public string FailureMessage { get; set; } | ||
public ShouldExpectResult ExpectResult { get; set; } | ||
} | ||
|
||
public class ShouldExpectResult | ||
{ | ||
public string Actual { get; set; } | ||
public string Expected { get; set; } | ||
public string Because { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
return $"Expected: {Expected} Actual: {Actual} Because: {Because}"; | ||
} | ||
} | ||
} |
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
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.