Pose 👥
Replace any .NET method (including static and non-virtual) with a delegate. 💎
It is similar to Microsoft Fakes but unlike it Pose is implemented entirely in managed code (Reflection Emit API).✨
Everything occurs at runtime and in-memory, no unmanaged Profiling APIs and no file system pollution with re-written assemblies.⚡️
Example Usage 🔥:
Shim static property getter ⏱:
[ Github ] : github.com/tonerdo/pose
〰〰〰〰〰〰
#CSharp #DotNet #Fake
@ProgrammingTip
Replace any .NET method (including static and non-virtual) with a delegate. 💎
It is similar to Microsoft Fakes but unlike it Pose is implemented entirely in managed code (Reflection Emit API).✨
Everything occurs at runtime and in-memory, no unmanaged Profiling APIs and no file system pollution with re-written assemblies.⚡️
Example Usage 🔥:
Shim static property getter ⏱:
Shim dateTimeShim = Shim.Replace(() => DateTime.Now).With(() => new DateTime(2004, 4, 4));
Usage 👾:// This block executes immediately
PoseContext.Isolate(() =>
{
// All code that executes within this block
// is isolated and shimmed methods are replaced
// Outputs "4/4/04 12:00:00 AM"
Console.WriteLine(DateTime.Now);
}, dateTimeShim);
https://t.me/pgimg/179[ Github ] : github.com/tonerdo/pose
〰〰〰〰〰〰
#CSharp #DotNet #Fake
@ProgrammingTip
Telegram
Programming Tips Resources