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

PR: Initial merge as requested by Royal Mail #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rf-0
Copy link

@rf-0 rf-0 commented Jun 1, 2023

No description provided.

rf-0 added 3 commits June 1, 2023 11:18
…store seems to be read from options appsettings and not request and forgot to update code
…ust pseudocode before). Also added some more tests for 100% coverage for the ones being tested.
@neilhewitt
Copy link

Hi Ricardo.

Can you explain what you mean by the tests being 'pseudo-code' before? When the instructions ask you to add suitable tests, we do assume that those will be working tests that pass. I also note you've fixed your strategy classes so that they do now work correctly, but had the tests been complete and working originally, you would presumably have spotted these issues immediately.

Did you run out of time? To be clear, the two-hour thing is not intended to be a hard timebox, just an estimate of the rough amount of refactoring effort we'd expect to see.

We have moved this exercise to a new repo and updated the instructions. I appreciate you worked from this repo with the old instructions, hopefully it'll be clearer in future.

@rf-0
Copy link
Author

rf-0 commented Jun 5, 2023

Hi Neil,

Can you explain what you mean by the tests being 'pseudo-code' before? When the instructions ask you to add suitable tests, we do assume that those will be working tests that pass. I also note you've fixed your strategy classes so that they do now work correctly, but had the tests been complete and working originally, you would presumably have spotted these issues immediately.

Since both projects (src + tests) were not runnable (csproj config + program.cs) I thought the goal of the exercise was to write the code and then have another interview to go through it so I never actually ran them. A bad assumption from my side. Indeed, after getting the tests running, the strategy tests didn't pass as the implementation logic was wrong ('&&' instead of '||') which I then fixed. They would have indeed been flagged immediately as they have after running them.

Did you run out of time? To be clear, the two-hour thing is not intended to be a hard timebox, just an estimate of the rough amount of refactoring effort we'd expect to see.

I did use the whole 2 hours. I could have gone for full coverage, and it would have taken me maybe another 10-15min in that case. The 2 hours were enough for the whole exercise though.

@rf-0
Copy link
Author

rf-0 commented Jun 5, 2023

Hi Neil,

I just realised that I didn't update the request object (MakeMailTransferRequest) with the value object (MailContainerNumber). Is it ok if I push a quick change? (won't affect tests)

@neilhewitt
Copy link

Since both projects (src + tests) were not runnable (csproj config + program.cs) I thought the goal of the exercise was to write the code and then have another interview to go through it so I never actually ran them. A bad assumption from my side. Indeed, after getting the tests running, the strategy tests didn't pass as the implementation logic was wrong ('&&' instead of '||') which I then fixed. They would have indeed been flagged immediately as they have after running them.

OK, that makes more sense. It sounds like the instructions need to be clearer. We would discuss your code in the next interview stage, certainly, but the test exercise is designed to stand alone.

If you can finish up your pending change, I can look at the final code, and then we can close the loop on this.

…) solves a few things, like SRP and DRY as the object itself is now responsible for the preconditions validation (ie: null checks)
@rf-0
Copy link
Author

rf-0 commented Jun 5, 2023

This is now done/complete.

…own value object and encapsulated its state (SRP)
@rf-0
Copy link
Author

rf-0 commented Jun 7, 2023

Ended up doing 1 more push as I noticed the strategies were missing checking the NumberOfMailItems and Capacity validation and noticed as well that state was not properly encapsulated. Will understand if this commit is not considered as this was done later than the stipulated exercise time and you might have already spent time reviewing the code / tests. Unfortunately, this required changes to tests code.

@neilhewitt
Copy link

That's fine, Ricardo. I think AMS will have been in touch about setting up a final interview - please work with them and we'll get it booked in.

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