https://github.com/i-e-b/liteproxy
Tiny object proxying and mocking tools for C#
https://github.com/i-e-b/liteproxy
c-sharp legacy-support reflection test-driven-development working
Last synced: 9 months ago
JSON representation
Tiny object proxying and mocking tools for C#
- Host: GitHub
- URL: https://github.com/i-e-b/liteproxy
- Owner: i-e-b
- License: bsd-3-clause
- Created: 2014-02-10T11:17:33.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-05-14T13:49:30.000Z (about 8 years ago)
- Last Synced: 2025-09-14T23:19:09.671Z (10 months ago)
- Topics: c-sharp, legacy-support, reflection, test-driven-development, working
- Language: C#
- Homepage:
- Size: 180 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
LiteProxy
=========
Tiny object proxying tools for C#
Features:
---------
`DynamicProxy.GetInstanceFor<...>();` -- Pass the type of an interface or abstract, and you will get an object instance that implements that type and backs the properties and fields.
`Extract.From(Instance)` -- Wraps an object instance in a proxy. Use this to coerce objects into interfaces they *could* implement.
`LazyDelegate.For(...)` -- Wraps a constructor function in a proxy that overrides all virtual properties. Any access to the properties will cause the function to be invoked and calls passed to the result.
`LazyDelegate.ForKeyed("Id", MyValue, ConstructorFunc)` -- Same as LazyDelegate.For, but this causes one named property with an initial value to skip the lazy invocation.
TODO
------
1. Add the delegating behaviour of `Extract<>.From()` to `DynamicProxy`.
2. Expose the delegating object (as dynamic?) through dynamic proxy generation
* methods are always mapped to delegate object
* fields are mapped to delegate if they exist, otherwise getters, setters and backing field are added as currently