Skip to content

Improve user-facing messages #3175

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

Merged
merged 3 commits into from
Feb 23, 2019

Conversation

jnm2
Copy link
Contributor

@jnm2 jnm2 commented Feb 23, 2019

Ran out of time, but small PRs are fun PRs. I didn't get to the motivating example I ran into today, so I'll be back with more soon.

We should try to use full sentences in all messages to the user, including obsoletion and exception messages, message boxes, console messages, and XML documentation.

@jnm2 jnm2 added this to the 3.12 milestone Feb 23, 2019
@@ -213,9 +213,6 @@ public string LoadTests()
/// <returns>The XML result of exploring the tests</returns>
public string ExploreTests(string filter)
{
if (Runner.LoadedTest == null)
throw new InvalidOperationException("The Explore method was called but no test has been loaded");

return Runner.ExploreTests(TestFilter.FromXml(filter)).ToXml(true).OuterXml;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is literally the first thing Runner.ExploreTests does.

throw new InvalidOperationException("The Explore method was called but no test has been loaded");

handler.RaiseCallbackEvent(Runner.ExploreTests(TestFilter.FromXml(filter)).ToXml(true).OuterXml);
handler.RaiseCallbackEvent(ExploreTests(filter));
Copy link
Contributor Author

@jnm2 jnm2 Feb 23, 2019

Choose a reason for hiding this comment

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

Identical implementation within a project should be shared.

@jnm2 jnm2 force-pushed the improve_user_facing_messages branch from 86acc5d to 780a7c4 Compare February 23, 2019 16:23
@jnm2 jnm2 changed the title Improve user facing messages Improve user-facing messages Feb 23, 2019
@jnm2 jnm2 force-pushed the improve_user_facing_messages branch from 780a7c4 to f2d4a96 Compare February 23, 2019 16:43
@jnm2
Copy link
Contributor Author

jnm2 commented Feb 23, 2019

@nunit/framework-team Fixed the test failures. Ready for review.

Copy link
Member

@CharliePoole CharliePoole left a comment

Choose a reason for hiding this comment

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

This is pretty wide-ranging but looks good to me.

It does bring up for me a related question: Should these all be user-facing messages? At least a few of them can only arise due to a programming error in the console, for example, the message about calling explore before the test has been loaded. Maybe those type of messages should simply be eliminated or prefixed with something like "Internal Error:"

However, that could be done separately if we want to change it.

Copy link
Member

@ChrisMaddock ChrisMaddock left a comment

Choose a reason for hiding this comment

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

LGTM!

@ChrisMaddock ChrisMaddock merged commit ad943eb into nunit:master Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants