Skip to content

Commit

Permalink
#4 Update testing framework in MethodRewriterTests.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
sguldmund committed Jan 12, 2024
1 parent 86eed30 commit 01c5aa4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/Pose.Tests/IL/MethodRewriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace Pose.Tests
{
using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;

public class MethodRewriterTests
{
[Fact]
Expand All @@ -25,7 +23,7 @@ public void Can_rewrite_static_method()
var func = dynamicMethod.CreateDelegate(typeof(Func<DateTime>));

// Assert
Assert.AreEqual(DateTime.Now.ToString("yyyyMMdd_HHmm"), ((DateTime)func.DynamicInvoke()).ToString("yyyyMMdd_HHmm"));
func.DynamicInvoke().As<DateTime>().Should().BeCloseTo(DateTime.Now, TimeSpan.FromSeconds(10));
}

[Fact]
Expand All @@ -40,7 +38,7 @@ public void Cannot_rewrite_method_in_CoreLib()
var func = dynamicMethod.CreateDelegate(typeof(Func<DateTime>));

// Assert
Assert.AreEqual(DateTime.Now.ToString("yyyyMMdd_HHmm"), ((DateTime)func.DynamicInvoke()).ToString("yyyyMMdd_HHmm"));
func.DynamicInvoke().As<DateTime>().Should().BeCloseTo(DateTime.Now, TimeSpan.FromSeconds(10));
}

[Fact]
Expand Down

0 comments on commit 01c5aa4

Please sign in to comment.