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

Bus should be a property not a field #432

Merged
merged 4 commits into from
Nov 14, 2018

Conversation

AnthonySteele
Copy link
Contributor

@AnthonySteele AnthonySteele commented Nov 13, 2018

Summarise the changes this Pull Request makes.

Bus should be a get-only property not a read-only field
Compliance with analyser rule: https://docs.microsoft.com/en-gb/visualstudio/code-quality/ca1051-do-not-declare-visible-instance-fields
This is a quick, shallow fix in order to get the analysers passing, pending a better design.

Please include a reference to a GitHub issue if appropriate.

#401

Bus should be a property not a field
Compliance with analyser rule: https://docs.microsoft.com/en-gb/visualstudio/code-quality/ca1051-do-not-declare-visible-instance-fields
This is shallow fix in order to get the analysers passing, pending better design
@AnthonySteele AnthonySteele requested a review from a team as a code owner November 13, 2018 13:56
martincostello
martincostello previously approved these changes Nov 13, 2018
@AnthonySteele
Copy link
Contributor Author

WAT

@martincostello
Copy link
Member

@AnthonySteele
Copy link
Contributor Author

AnthonySteele commented Nov 13, 2018

// ToDo: Must do better!!

That's not wrong.

but arguably no worse
and the tests pass
This PR is aimed at the analyser warning in JustSaying, not the tests
and did I mention that the tests pass now?
@@ -28,7 +28,7 @@ public class JustSayingFluently : ISubscriberIntoQueue, IHaveFulfilledSubscripti
private readonly ILogger _log;
private readonly IVerifyAmazonQueues _amazonQueueCreator;
private readonly IAwsClientFactoryProxy _awsClientFactoryProxy;
protected IAmJustSaying Bus { get; }
protected IAmJustSaying Bus { get; private set; }
private SqsReadConfiguration _subscriptionConfig = new SqsReadConfiguration(SubscriptionType.ToTopic);
Copy link
Member

Choose a reason for hiding this comment

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

Could we get away with internal and use InternalsVisibleTo?

Copy link
Member

Choose a reason for hiding this comment

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

If the test isn't super important and just belt-and-braces, we should remove it. It's a self-documented cludge, so if it's not adding much value we should just 🗑 it if it's causing us trouble here.

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 test looks like it's a base class for a lot of things :(

Copy link
Member

Choose a reason for hiding this comment

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

Bah. A super-cludge.

Copy link
Member

Choose a reason for hiding this comment

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

This is the theme in general with a lot of the tests

Copy link
Member

Choose a reason for hiding this comment

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

protected internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same.

Copy link
Member

Choose a reason for hiding this comment

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

I meant for the whole property, not just the setter.

Copy link
Member

Choose a reason for hiding this comment

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

Well TIL. https://stackoverflow.com/a/1063920/2225808
You could have a method that sets it, and is internal. 🤔 🤢

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, protected internal for the property is what we want

slang25
slang25 previously approved these changes Nov 14, 2018
@slang25
Copy link
Member

slang25 commented Nov 14, 2018

Turns out there are more of those reflection setters 😆

Copy link
Member

@slang25 slang25 left a comment

Choose a reason for hiding this comment

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

2 less WATs!

@AnthonySteele
Copy link
Contributor Author

That's better.

@AnthonySteele AnthonySteele merged commit e5f61d0 into justeattakeaway:master Nov 14, 2018
@martincostello martincostello added this to the v7.0.0 milestone Nov 16, 2018
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.

3 participants