Pose allows you to 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. Pose is cross-platform and runs anywhere .NET is supported. It targets .NET Standard 2.0 so it can be used across .NET platforms including .NET Framework, .NET Core, Mono, and Xamarin. Pose gives you the ability to create shims by way of the Shim class. Shims are basically objects that let you specify the method you want to replace as well as the replacement delegate. Delegate signatures (arguments and return type) must match that of the methods they replace. The Is class is used to create instances of a type and all code you want to apply your shims to is isolated using the PoseContext class.
Features
- Shim static method
- Shim static property getter
- Shim instance property getter
- Shim instance property setter
- Shim instance property setter
- Shim instance method of a Reference Type