DatabaseTargetTests - Add coverage for DbConnectionFactory constructor#67
DatabaseTargetTests - Add coverage for DbConnectionFactory constructor#67JohnVerheij wants to merge 1 commit intoNLog:masterfrom
Conversation
|
Thank you for the contribution. Since there already multiple tests that verifies that
I think these tests are already covered by existing test:
|
|
The 7 tests cover the The 4 you want to keep cover defensive cases (null factory, factory-returns-null, factory-throws) and parameters-write. The 3 you want to drop (Simple, Batched, KeepConnection) give the factory constructor parity with the write-mode coverage the existing tests provide for the connection-string constructor. Architecturally both constructors set |
Adds direct test coverage for the
DatabaseTarget(Func<IDbConnection>)constructor introduced in NLog/NLog#5878. The factory constructor was previously covered indirectly throughDbTypeEnumSetterTest,DbTypeSetterTest, andDbFactoryConnectionStringTest1/2; this brings parity with the existing tests for the legacyDBProviderconstructor.Tests added:
DbConnectionFactoryNullTest- null factory throwsArgumentNullExceptionDbConnectionFactoryReturnsNullTest- factory returning null surfacesNLogRuntimeExceptionDbConnectionFactoryThrowsTest- factory exceptions propagate to the async continuationDbConnectionFactorySimpleWriteTest- end-to-end single writeDbConnectionFactoryBatchedWriteTest- end-to-end batched writeDbConnectionFactoryKeepConnectionTest- persistent-connection modeDbConnectionFactoryWithParametersWriteTest- end-to-end write withAction<IDbDataParameter>parameter setterAll 222 tests pass on net8.0. No production code changes.