-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into 12-add-async-support
- Loading branch information
Showing
4 changed files
with
42 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using FluentAssertions; | ||
using Xunit; | ||
using DateTime = System.DateTime; | ||
|
||
namespace Pose.Tests | ||
{ | ||
public class RegressionTests | ||
{ | ||
private enum TestEnum { A } | ||
|
||
[Fact(DisplayName = "Enum.IsDefined cannot be called from within PoseContext.Isolate #26")] | ||
public void Can_call_EnumIsDefined_from_Isolate() | ||
{ | ||
// Arrange | ||
var shim = Shim | ||
.Replace(() => new DateTime(2024, 2, 2)) | ||
.With((int year, int month, int day) => new DateTime(2004, 1, 1)); | ||
var isDefined = false; | ||
|
||
// Act | ||
PoseContext.Isolate( | ||
() => | ||
{ | ||
isDefined = Enum.IsDefined(typeof(TestEnum), nameof(TestEnum.A)); | ||
}, shim); | ||
|
||
// Assert | ||
isDefined.Should().BeTrue(because: "Enum.IsDefined can be called from Isolate"); | ||
} | ||
} | ||
} |