ObjectFiller.NET
ObjectFiller.NET copied to clipboard
Exception when creating a collection of simple objects
I wanted to create a list of objects. They must be of type object. I was not able to create them with Randomizer
Exception:
System.TypeInitializationException : Der Typeninitialisierer für "System.Object" hat eine Ausnahme verursacht.
----> System.Exception : The type [Object] was not registered in the randomizer.
bei Tynamix.ObjectFiller.Filler1.GetRandomValue(Type propertyType, FillerSetupItem setupItem) bei Tynamix.ObjectFiller.Filler1.CreateAndFillObject(Type type, FillerSetupItem currentSetupItem, HashStack1 typeTracker) bei Tynamix.ObjectFiller.Filler1.Create()
bei Tynamix.ObjectFiller.Filler`1.Create(Int32 count)
Then I tried this setup:
Filler<object> objectFiller = new Filler<object>();
objectFiller.Setup().OnType<object>().CreateInstanceOf<string>();
with this call:
objectFiller.Create(110)
and got the same Exception.