ManualStunts
An example of hand-coding stunts using the behavior pipeline directly. This is not the typical usage pattern for Stunts, where the proxies are generated instead by compile-time or run-time generators.
Install
| Product | Versions |
|---|---|
| .NET Standard |
README
NOTE: even though generated proxies are the main usage for Stunts, the API was designed so that you can also consume the behavior pipeline easily from hand-coded proxies too.
Samples
The samples folder in the repository contains a few interesting examples of how Stunts can be used to implement some fancy use cases. For example:
Forwarding calls to matching interface methods/properties (by signature) to a static class. The example uses this to wrap calls to System.Console via an IConsole interface.
Forwarding calls to a target object using the DLR (that backs the dynamic keyword in C#) API for high-performance late binding.
Custom
Stub.Of<T>factory that creates stunts that have common behaviors configured automatically.Custom stunt factory method that adds an int return value randomizer.
Configuring the built-in DefaultValueBehavior so that every time a string property is retrieved, it gets a random lorem ipsum value.
Logging all calls to a stunt to the Xunit output helper.
Open Source Maintenance Fee
To ensure the long-term sustainability of this project, users of this package who generate revenue must pay an Open Source Maintenance Fee. While the source code is freely available under the terms of the License, this package and other aspects of the project require adherence to the Maintenance Fee.
To pay the Maintenance Fee, become a Sponsor at the proper OSMF tier. A single fee covers all of Devlooped packages.
Sponsors
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.