Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion exercises/sum-of-multiples/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"exercise": "sum-of-multiples",
"version": "1.0.0",
"version": "1.1.0",
"cases": [
{
"description": "multiples of 3 or 5 up to 1",
Expand All @@ -16,6 +16,13 @@
"limit": 4,
"expected": 3
},
{
"description": "multiples of 3 up to 7",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great 👍

Is this the best place for this test?
Is it simpler than the earlier cases?
Only having 1 factor makes it look simpler to me, but I'm not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I personally think it looks a little weird going back and forth between multiples of 3 and 5, and then a single 3 -- but following the approach I gave earlier, it makes the most sense. Again, to solve Test 1 and Test 2 all you're doing is:

    public static int Sum(IEnumerable<int> multiples, int max)
    {
        if(max > 3)
        {
            return 3;
        }

        return 0;
    }

That's a big reason to adjust the previous tests, mostly because I think you just completely ignore the 5 case anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Insti What do you feel about @jpreese's explanation? Is that okay? If so, is this ready to be merged or are there still changes to me made?

Copy link
Copy Markdown
Contributor

@Insti Insti Sep 22, 2017

Choose a reason for hiding this comment

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

Yes, this is fine.
The PR as it is currently is OK to merge.

"property": "sum",
"factors": [3],
"limit": 7,
"expected": 9
},
{
"description": "multiples of 3 or 5 up to 10",
"property": "sum",
Expand Down