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
Fill SortedLists #622
Comments
This issue was prompted by this Stack Overflow question. |
@ploeh I'd like to take a shot at implementing this. I'm a newbie to git. I forked and have it going in VS locally. I assume I send a pull request when it is ready. Do you assign the issue to me, or is that not necessary? I don't see a way to assign it to myself. |
@sbrockway announcing you're going to have a go at it should be enough, assigning shouldn't be necessary 👍 |
@sbrockway, @adamchester is right: making the announcement is usually enough. AutoFixture is a moderately successful open source project, so it sees a steady trickle of contributions, but I don't think I've ever seen a case where several contributors compete to do the same feature 😄 Other, more popular, projects may do things differently, so you did the right thing by asking 👍 If you need help with anything, please ask 😄 |
I'm having trouble learning how to use GitHub. Apologies for the pull request yesterday, I was trying to re-base my fork and it mis-guessed which direction the pull request was moving. I figured it out and got my repo up to date. |
I don't know what your repo looks like. While I could look at your fork, I can't see what it looks like on your local machine, so it's difficult for me to offer concrete advice. Often, with Git, if you're hopelessly lost, the easiest way out might be to start over with a new branch. That ensures that the original branch remains intact. This is important, because what I often hear that people do with Git is that in desperation, they attempt to run a command they don't fully understand, and they then end up deleting their work - for good! The best advice I can give regarding Git is to take your time, and only do things you fully understand. In the rare cases where you'd like to attempt something you don't fully understand, at least do yourself the favour of creating a copy of your repository somewhere else. The beauty of Git is that it's fully file-based, so a (temporary) 'backup' can be as simple as copying the repository folder to your desktop. |
When you ask AutoFixture for a dictionary, it provides a non-empty value:
When you request a sorted list, on the other hand, the returned list is empty. This test fails its assertion:
Since AutoFixture can already supply non-empty dictionaries, and one of the constructor overloads for
SortedList<TKey, TValue>
takes a dictionary, it ought to be fairly easy to add a relay fromSortedList<TKey, TValue>
toIDictionary<TKey, TValue>
.The implementation could for example be a new
ISpecimenBuilder
that handles requests for anySortedList<TKey, TValue>
by resolvingIDictionary<TKey, TValue>
from thecontext
, and then invoking the appropriate constructor overload with the returned value.Another implementation option is to mimic the way concrete dictionaries are already filled. See the combination of
DictionaryFiller
andDictionarySpecification
in theFixture
class.The text was updated successfully, but these errors were encountered: