-
Notifications
You must be signed in to change notification settings - Fork 36
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
PT-6909 Extracted reader options to builder from private methods #112
Conversation
Codecov Report
@@ Coverage Diff @@
## master #112 +/- ##
==========================================
+ Coverage 35.19% 36.53% +1.34%
==========================================
Files 6 8 +2
Lines 233 260 +27
==========================================
+ Hits 82 95 +13
- Misses 145 159 +14
Partials 6 6
Continue to review full report at Codecov.
|
assert.Equal(t, tableCfg.Filter.Match, tableOpt.Match) | ||
assert.Equal(t, tableCfg.Filter.Limit, tableOpt.Limit) | ||
assert.Equal(t, tableCfg.Filter.Sorts, tableOpt.Sorts) | ||
|
||
require.Equal(t, len(tableCfg.Relationships), len(tableOpt.Relationships)) | ||
for i := range tableCfg.Relationships { | ||
assert.Equal(t, tableCfg.Relationships[i].Table, tableOpt.Relationships[i].Table) | ||
assert.Equal(t, tableCfg.Relationships[i].ForeignKey, tableOpt.Relationships[i].ForeignKey) | ||
assert.Equal(t, tableCfg.Relationships[i].ReferencedTable, tableOpt.Relationships[i].ReferencedTable) | ||
assert.Equal(t, tableCfg.Relationships[i].ReferencedKey, tableOpt.Relationships[i].ReferencedKey) | ||
} |
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.
Why not use assert.EqualValues
?
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.
tableCfg.Relationships
and tableOpt.Relationships
have different types, but fields list is the same
|
||
assert.Equal(t, tableCfg.Filter.Match, tableOpt.Match) | ||
assert.Equal(t, tableCfg.Filter.Limit, tableOpt.Limit) | ||
assert.Equal(t, tableCfg.Filter.Sorts, tableOpt.Sorts) |
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.
should be here require
as well?
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.
not need to stop test if this condition is failing, we can check other asserts as well even if this one is bad
One more piece extracted from #110
This time - reader options extracted from implementations private methods to a builder function.