I have a type and want to create an instance of it with test data.
I know that frameworks like NBuilder or AutoFixture can create instances of types that are known on design time (<T>
). Are those frameworks able to create an instance based on a type that is only known at runtime (Type
)?
On the end I want to do something like:
var value = Builder.Create(type);
var constant = Expression.Constant(value, type);