Non generic version of A.Fake(Type t) is missing
See original GitHub issueTo be able to use FakeItEasy in conjunction with Simple Injector, I’d like to do the following:
container.ResolveUnregisteredType +=
(sender, args) => args.Register(() =>A.Fake(args.UnregisteredServiceType));
However, there is no publicly available method that supports providing the type as non generic argument, although IFakeAndDummyManager.CreateFake
works this way (but is internal).
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Non-generic Fake and Dummy creation · Issue #482
I just realized that A.Fake doesn't have a non-generic overload accepting a Type parameter, which would be very useful in some scenarios.
Read more >Why are missing type parameters inferred as unknown in ...
I would expect the call of doStuff to be an error as the type parameter is missing. Instead it infers unknown so the...
Read more >Allow Faking of non-generic types with methods that have in ...
NET Standard, and if the type is a generic type, it cannot be faked by either the FakeItEasy .NET Standard or .NET Framework...
Read more >Go generics are not bad
Can't hate on generics, so we need to find something else. Go takes away type system fidget spinners and leave devs with nothing...
Read more >4. Generics - Programming C# 5.0 [Book]
In Chapter 3, I showed how to write types and described the various kinds of members they can contain. However, there's an extra...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @marcwittke,
The non-generic API exists, but it’s hidden because it’s not commonly used by most people:
FakeItEasy.Sdk.Create.Fake(Type)
.this
FakeItEasy.Sdk.Create.Fake(Type)
was exactly what I was missing, thanks. sorry for the delay…