Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add FormatterServices.GetUninitializedObject, partial for #8133 #8570

Merged
merged 5 commits into from
May 16, 2016

Conversation

danmoseley
Copy link
Member

No description provided.

@dnfclas
Copy link

dnfclas commented May 16, 2016

Hi @danmosemsft, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@danmoseley
Copy link
Member Author

@weshaggard PTAL

@dnfclas
Copy link

dnfclas commented May 16, 2016

@danmosemsft, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

{
public static class FormatterServicesTests
{
private static Func<Type, Object> geo = FormatterServices.GetUninitializedObject;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: geo => s_geo
It can also be readonly.

Copy link
Member

Choose a reason for hiding this comment

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

That said... why use a delegate at all? Why not just call FormatterServices.GetUnitializedObject in each test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Readability :) I'll remove it.

@stephentoub
Copy link
Member

LGTM

@danmoseley
Copy link
Member Author

@stephentoub What's the protocol now -- I wait for the tests to go green, then hit merge myself?

@stephentoub
Copy link
Member

What's the protocol now -- I wait for the tests to go green, then hit merge myself?

Yes, though it'd be good for @weshaggard to take a look as well, in particular to make sure that the contract update is good.

}

[Theory]
[MemberData(nameof(TestData))]
Copy link

Choose a reason for hiding this comment

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

Nit: Does this need to be MemberData?

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, MemberData seems to mean "invoke this static function as an interator to generate test data" while InlineData means "here lies inline data"

Copy link

@hughbe hughbe May 16, 2016

Choose a reason for hiding this comment

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

Sorry, I mean the TestData() could be InlineData: there's nothing in the enumerator that needs to have its own method

Copy link
Member Author

Choose a reason for hiding this comment

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

oh - you're quite right, it previously had but I modified it.

@danmoseley danmoseley merged commit 112ff9a into dotnet:master May 16, 2016
@danmoseley danmoseley deleted the danmosegetuninit branch May 16, 2016 21:20
@weshaggard
Copy link
Member

LGTM

danmoseley added a commit to danmoseley/corefx that referenced this pull request May 18, 2016
…nit"

This reverts commit 112ff9a, reversing
changes made to eeddd33.
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Add FormatterServices.GetUninitializedObject, partial for dotnet/corefx#8133

Commit migrated from dotnet/corefx@112ff9a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants