Non-generic Fake and Dummy creation
See original GitHub issueI just realized that A.Fake
doesn’t have a non-generic overload accepting a Type
parameter, which would be very useful in some scenarios. I realize that it’s not something most people would need on a regular basis, but there doesn’t seem to be a good workaround. The only way I found was to call A.Fake<T>()
via reflection, which is far from ideal.
Am I missing something?
Perhaps adding a non-generic overload to A.Fake
wouldn’t be the best option, because would pollute the API with something that is not usually useful, but it would be nice to have an easy workaround.
Issue Analytics
- State:
- Created 8 years ago
- Comments:42 (39 by maintainers)
Top Results From Across the Web
Dummies
For cases where the type of dummy isn't statically known, non-generic ... When creating Fakes or Dummies of class types, FakeItEasy needs to...
Read more >Mocking generic methods in Moq without specifying T
I would like to mock the class that contains this method without having to specify Setup methods for every type it could be...
Read more >How to Generate Test Data/Dummy Data/ Fake data/ Mock ...
In the above example, I am creating an object of Bogus.Faker class. Faker is a generic class that takes class as a generic...
Read more >mockall - Rust
A powerful mock object library for Rust. Mockall provides tools to create mock versions of almost any trait or struct. They can be...
Read more >Generics
Generics are used for metaprogramming in Ada. They are useful for abstract algorithms that share common properties with each other. Either a subprogram...
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
I’m for reopening.
One oddball person coming out of nowhere and requesting the feature is one matter, but now that we have two such people, it appears that the feature would fill a desperate need. And who knows, maybe someday @ploeh will not mind taking a dependency on a modern FakeItEasy and he can have prettier code in AutoFixture.
This issue has been fixed in release 2.1.0.