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

Resolves #467 by relaying non-seeded requests. #471

Merged
merged 1 commit into from
Nov 20, 2015

Conversation

ecampidoglio
Copy link
Member

This PR modifies the SeededFactory<T> class to relay also non-seeded requests for T to the custom factory function passing the default value of T as a seed. This is to solve #467.

@@ -129,5 +129,23 @@ public void CreateWithCorrectlyTypedSeededRequestWithNullSeedReturnsCorrectResul
Assert.Equal(expectedResult, result);
// Teardown
}

[Fact]
public void CreateWithCorrectlyTypedRequestReturnsCorrectResult()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this test slightly overspecify the implementation details?

If we didn't have this test, wouldn't it leaves us more flexibility with regards to future refactoring?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that test was superseded by these scenario tests introduced in 28bb833. I'll remove it.

The SeededFactory<T> class did not handle non-seeded requests
for the specified type T. This resulted in an ObjectCreationException
when AutoFixture had to create specimens to populate properties,
fields and parameters of type T.
@ecampidoglio ecampidoglio added bug and removed bug labels Nov 17, 2015
@ploeh ploeh merged commit c7ce7d2 into master Nov 20, 2015
@ploeh ploeh deleted the 467-create-value-from-seed branch November 20, 2015 13:31
@ploeh
Copy link
Member

ploeh commented Nov 20, 2015

Thank you for your contribution! It's now live as AutoFixture 3.36.12.

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

Successfully merging this pull request may close these issues.

2 participants