PrintsCharming / ObjectHydrator

This project allows you to pass custom POCO's to it, and have it return an instance of the class populated with randomly generated data. This random data can be overridden by convention.
Apache License 2.0
39 stars 19 forks source link

Generic EnumGenerator #16

Closed deathgore closed 7 years ago

deathgore commented 8 years ago

Hydrator.WithEnum generates a System.InvalidCastException

System.InvalidCastException : Unable to cast object of type 'Foundation.ObjectHydrator.Generators.EnumGenerator' to type 'Foundation.ObjectHydrator.Interfaces.IGenerator1[Foundation.ObjectHydrator.Tests.POCOs.CustomerType]'. at Foundation.ObjectHydrator.Hydrator1.WithEnum[TProperty](Expression`1 expression, Array enumValues) in D:\git_external\ObjectHydrator\Foundation.ObjectHydrator\Hydrator.cs:line 215 at Foundation.ObjectHydrator.Tests.HydratorTests.Hydrator_ComplexCustomer_Tests.CanLoadSingleComplexCustomerWithEnum() in D:\git_external\ObjectHydrator\Foundation.ObjectHydrator.Tests\HydratorTests\Hydrator_ComplexCustomer_Tests.cs:line 122

PrintsCharming commented 8 years ago

I love the Nullable Generators, thank you!

I'll need to check the nuspec changes, hopefully this weekend. Thank you indeed.

PrintsCharming commented 7 years ago

Took me awhile but there we go....working on a little bit of a re-write