Conversation
|
|
||
| protected virtual NpgsqlDataSource DataSource => DefaultDataSource; | ||
|
|
||
|
|
| await using var tx = await connection.BeginTransactionAsync(); | ||
| Assert.Null(connection.Connector!.DatabaseInfo.CompositeTypes.SingleOrDefault(c => c.Name.Contains(table))); | ||
| Assert.Null(connection.Connector!.DatabaseInfo.ArrayTypes.SingleOrDefault(c => c.Name.Contains(table))); | ||
| Assert.That(connection.Connector!.DatabaseInfo.CompositeTypes.SingleOrDefault(c => c.Name.Contains(table)), Is.Null); |
There was a problem hiding this comment.
I definitely like that this removes AreEqual, replacing them with Is.EqualTo instead (making it clear what's the expected and what's the actual), but for Assert.Null it seems to mainly make the assertion more verbose... Is this something we have to do (because the analyzers recommend it), or can we not to do it?
There was a problem hiding this comment.
Same feeling here.
NUnit v4 enforces the fluent syntax even if sometimes it makes the assertions more verbose.
The previous assert methods are still available in a ClassicAssert static class, but I would recommend to not mix both solutions in the same project.
|
|
||
| var exception = await AssertTypeUnsupportedWrite(Mood.Happy, enumType); | ||
| Assert.IsInstanceOf<NotSupportedException>(exception.InnerException); | ||
| Assert.That(exception.InnerException, Is.InstanceOf<NotSupportedException>()); |
There was a problem hiding this comment.
As with IsNull, previous seems slightly better to me...
| {1} | ||
| Exception {2}", | ||
| i, FormatEventQueue(eventQueue), ex); | ||
| Assert.Fail($"Failed at iteration {i}.\r\nEvents:\r\n{FormatEventQueue(eventQueue)}\r\nException {ex}"); |
There was a problem hiding this comment.
This doesn't look like a good change to me (especially since it encodes a particular type of newline sequence). I'd convert this to a raw literal string instead (""").
There was a problem hiding this comment.
Moved to raw strings
No description provided.