-
Notifications
You must be signed in to change notification settings - Fork 20
Slightly better asserts. #452
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.
minor
@@ -23,7 +23,7 @@ public void LoadsDatabaseSmokeTest (PlatformName platform, int expectedLowerLimi | |||
var database = importer.Import (); | |||
Assert.IsNotNull (database, $"null database for {platform}"); | |||
Assert.Less (expectedLowerLimit, database.Count, $"Expected at least {expectedLowerLimit} db entries, but got {database.Count} entries."); | |||
Assert.IsTrue (!errors.AnyErrors, $"{errors.ErrorCount} errors importing database."); | |||
errors.AssertNoErrors ("errors importing database."); |
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.
an error with $"{errors.ErrorCount} errors while {whileDoing}"
and "errors importing database."
will give you
"1 errors while errors importing database."
@@ -23,7 +23,7 @@ public void LoadsDatabaseSmokeTest (PlatformName platform, int expectedLowerLimi | |||
var database = importer.Import (); | |||
Assert.IsNotNull (database, $"null database for {platform}"); | |||
Assert.Less (expectedLowerLimit, database.Count, $"Expected at least {expectedLowerLimit} db entries, but got {database.Count} entries."); | |||
Assert.IsTrue (!errors.AnyErrors, $"{errors.ErrorCount} errors importing database."); | |||
errors.AssertNoErrors ("importing database."); |
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.
Sanity check - would it make sense to make the "importing database" a constant for these tests?
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.
Sure! PRs welcome! 😄
Slightly better. Addressing this issue.
Past me clearly thought that this was going to be used more often than it is, but it's not fully YAGNI (you ain't gonna need it).
Future me may yet be grateful for past me's foresight.