Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying a large string length attribute like [StringLength(4000)] randomly exceptions #11

Open
jeremycook opened this issue Sep 12, 2015 · 0 comments

Comments

@jeremycook
Copy link
Contributor

It may be related to the TextGenerator's lorem ipsum having a length of 907. I see that you cap the length in one of TextGenerator's constructors, but I also see that the Length setter is public and therefore could be set to a number larger than 907.

Here's a stack trace:

at System.String.Substring(Int32 startIndex, Int32 length)
   at Foundation.ObjectHydrator.Generators.TextGenerator.Generate() in D:\DevProjects\2010Projects\ObjectHyrdrator\Foundation.ObjectHydrator\Generators\TextGenerator.cs:line 32
   at Foundation.ObjectHydrator.Mapping`1.Generate() in D:\DevProjects\2010Projects\ObjectHyrdrator\Foundation.ObjectHydrator\Mapping.cs:line 47
   at Foundation.ObjectHydrator.Hydrator`1.Populate(Object instance) in D:\DevProjects\2010Projects\ObjectHyrdrator\Foundation.ObjectHydrator\Hydrator.cs:line 533
   at Foundation.ObjectHydrator.Hydrator`1.Generate() in D:\DevProjects\2010Projects\ObjectHyrdrator\Foundation.ObjectHydrator\Hydrator.cs:line 68
   at Foundation.ObjectHydrator.Hydrator`1.GetSingle() in D:\DevProjects\2010Projects\ObjectHyrdrator\Foundation.ObjectHydrator\Hydrator.cs:line 60
   // Snipped //

Result Message: 
Test method Bridge.EF.Tests.EFBridgeTests.InsertPosts threw exception: 
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant