Comments (5)
Hi, sorry you're facing issues.
It seems silly to ask since I haven't updated the library in awhile, but are you on the latest version 1.8.2? I ask because I added recursion loops in my last commit. To try and reproduce the issue, I created a sample object via properties A.B.C.A and could randomize it without issue. The mechanism for this is on the RandomizerChainer, which will add a recursive reference if the previous type has already been created.
Theoretically you shouldn't ever see the InfiniteLoopException, it means I missed a link in the creation chain and didn't set the parent correctly. I've located all the spots where that is seemingly possible, and have attempted a fix.
Nuget should have version 1.8.3 here soon, I'm hoping it fixes your issue. If not, I'll need more details over how your type chain that's triggering the exception appears. Like are collections involved, generics, abstract classes, delegates... ect. As long as I can reproduce the issue with a test model, I'll be able to get it fixed here for you.
from createandfake.
Hey, thanks for getting back to me. .
To answer your questions: Yes, I'm using version 1.8.2 and, while a rich object model, it is fairly simple so it does not use any (custom) generics, inheritance or delegates. It uses collections extensively and the issue I'm seeing involves a collection like so: a->ICollection<b>->c->a
.
Hope that will provide some clues as to the nature of the issue. If not, let me know and I'll endeavour to reproduce the issue in a repository I can share.
Thanks again,
Ian
from createandfake.
Did you see if version 1.8.3 worked for you?
I made another branch here to attempt to replicate and solve the issue, you can view the test here:
https://github.com/CreateAndFake/CreateAndFake/blob/Fix-65-InfiniteChainFix/tests/CreateAndFakeTests/IssueReplication/InfiniteChainTests.cs
I did encounter an issue with cloning objects, but not in creating them. So if you don't mind checking the model and comparing with yours I would be grateful.
from createandfake.
Hey, just updated to 1.8.3 and the InfiniteLoopException issue is gone. Great work, thanks!
I'll close this issue now but any interest in a PR to support Uri and DateTimeOffset creation / duplication? I'm using these types extensively and currently need to add custom Create/CopyHints to support them.
from createandfake.
I have added Uri and DateTimeOffset support in the default hints released on version 1.8.4.
from createandfake.
Related Issues (20)
- Clone Extension
- Text Asserts Missing Details
- Variant Extensions
- Better Generic Type Description in Assert Failures
- Self-Referencing Generic Type Create Infinite Loop HOT 1
- Error Randomizing Abstract Class with Generic Overloading
- Remove Binary Serialization
- Update to .NET 8
- Collections should ignore type when comparing by value
- Fix Publish Workflow
- Add 'Also' to Fluent Assert
- Use Seeds For Default Randoms
- Collection Size Attribute
- Thorough Documentation Review
- More Fluent Assert
- Fluent Arg Matching for Value Types
- Fluent Assert Fake Integration
- Compare Options
- Support IAsyncEnumerable
- Extension Method Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from createandfake.