-
-
Notifications
You must be signed in to change notification settings - Fork 365
Add Two Bucket Test Generator #447
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must say I'm really impressed with how you handled this! The only comments I have are on naming and a small simplification, but the general approach is spot on! 👍
exercises/two-bucket/TwoBucket.cs
Outdated
@@ -9,18 +9,18 @@ public enum Bucket | |||
public class TwoBucketResult | |||
{ | |||
public int Moves { get; set; } | |||
public Bucket GoalBucket { get; set; } | |||
public int OtherBucketContents { get; set; } | |||
public Bucket Goal_bucket { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to GoalBucket
, to conform to standard .NET naming guidelines.
exercises/two-bucket/TwoBucket.cs
Outdated
public Bucket GoalBucket { get; set; } | ||
public int OtherBucketContents { get; set; } | ||
public Bucket Goal_bucket { get; set; } | ||
public int Other_bucket { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to OtherBucket
, to conform to standard .NET naming guidelines.
exercises/two-bucket/TwoBucket.cs
Outdated
{ | ||
public TwoBuckets(int bucketOneSize, int bucketTwoSize, Bucket startBucket) | ||
public TwoBucket(int bucket_one, int bucket_two, Bucket start_bucket) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename the parameters to bucketOne
, bucketTwo
and startBucket
?
generators/Exercises/TwoBucket.cs
Outdated
foreach (var canonicalDataCase in canonicalData.Cases) | ||
{ | ||
canonicalDataCase.TestedMethodType = TestedMethodType.Instance; | ||
canonicalDataCase.SetConstructorInputParameters(new [] { "bucket_one", "bucket_two", "start_bucket"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SetConstructorInputParameters
take a param string[]
, which means you can simplify this to: SetConstructorInputParameters("bucket_one", "bucket_two", "start_bucket")
I was aware of breaking .net coding guidelines here. Wanted match canonical data properties with variables names. But I'll simply replace them in update canonical data method. Stay tuned 😉 |
Great! Let me say once again that I'm impressed with the quality of your PR! |
- Simplify SetConstructorInputParameters params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just wait for the CI to become green, and then I'll merge. Thanks a lot!
Thanks for the compliment! I think I'll grab another issue :) |
Yeah, this looks great @GKotfis! Just as a heads up, since you changed the name of the class, you'll also need to update the |
} | ||
|
||
public class TwoBuckets | ||
public class TwoBucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example.cs should be changed as well.
Everything's green, so I'll merge it. Thanks a lot! 🎉 |
I've mixed feelings about what I've done but maybe it's ok ;)
Please feel free to give some advice in case something needs change.