Skip to content

Fixes Grammar in SourceTextContainer exception message#203

Merged
Pilchie merged 5 commits intodotnet:masterfrom
Giftednewt:master
Feb 17, 2015
Merged

Fixes Grammar in SourceTextContainer exception message#203
Pilchie merged 5 commits intodotnet:masterfrom
Giftednewt:master

Conversation

@Giftednewt
Copy link
Contributor

This resolves #38 by fixing the grammar, removing the unused resource value and adding unit tests for SourceTextContainerExtensions

@Pilchie Pilchie self-assigned this Feb 3, 2015
Copy link
Member

Choose a reason for hiding this comment

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

Do you know what happened to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how that got removed. I didn't actually add or remove anything from the project file so I'll revert the change.

…ng newline back onto EditorServicesTest.csproj
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this just testing the behavior of the mocking framework?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention was to test that the GetTextBuffer extension method threw an argument exception when provided with a SourceTextContainer that was not a TextBufferContainer or derived type. Would it have been better to have written it as
Assert.Throws<ArgumentException>(() => Microsoft.CodeAnalysis.Text.Extensions.GetTextBuffer(containerMock.Object));

Or something similar?

I did also look at asserting on the ArgumentException message to make sure that the update resource text was returned however as this also returns the parameter name as part of the message I wasn't confident that this wouldn't make the test too brittle because someone could easily break the test just by changing the parameter name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, both @rchande and I were tricked by the extension method, so switching to the more obvious invocation would probably prevent others from being confused as well.

@Pilchie
Copy link
Member

Pilchie commented Feb 10, 2015

@Giftednewt did you want to go ahead and make those changes?

@Giftednewt
Copy link
Contributor Author

@Pilchie apologies, been working round the clock for my day job. I'm making the changes now.

@Pilchie
Copy link
Member

Pilchie commented Feb 16, 2015

@dnfclas
Copy link

dnfclas commented Feb 16, 2015

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

Thanks, DNFBOT;

Copy link
Member

Choose a reason for hiding this comment

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

Can you switch this to use nameof while you're already in there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

@Pilchie
Copy link
Member

Pilchie commented Feb 17, 2015

Thanks!

Pilchie added a commit that referenced this pull request Feb 17, 2015
Fixes Grammar in SourceTextContainer exception message
@Pilchie Pilchie merged commit 7ba4331 into dotnet:master Feb 17, 2015
@davkean davkean added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Bug Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grammar issue in SourceTextContainer exception message

7 participants