So I made a fully async DbDataAdapter - but how can I test Update/UpdateAsync correctly? #50402
Unanswered
daiplusplus
asked this question in
Show and tell
Replies: 2 comments 1 reply
-
Very nice work Jehoel Also, you were right he had missed a few ConfigureAwait(false) and at least one or two fetchasync opportunities (just taking a quick glance at what I did to get Voloda's code working locally) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently forked the older
AsyncDataAdapter
project ( originally https://www.nuget.org/packages/AsyncDataAdapter/ and https://github.com/voloda/AsyncDataAdapter ) to my own and completed the original creator's unfinished work to fully support all synchronous and asynchronous operations onDbDataAdapter
which is now available here:I've attempted to add full test coverage - or at least, as much test coverage, as I can - however I'm stuck w.r.t. testing
DbDataAdapter.Update
and myAsyncDbDataAdapter.UpdateAsync
because the documentation and examples are rather lacking, even the current reference-source code in is repo at https://github.com/dotnet/runtime/tree/main/src/libraries/System.Data.Common/src/System/Data seems to have no meaningful or useful comments - which is much-needed because of the various older C# idioms being used ("older", as in, the code dates back from .NET Framework 1.1 in 2000-2004, so it predates generics, extension methods, exception filters, etc). For example, the variousFill
,FillSchema
, andUpdate
(and myFillAsync
,FillSchemaAsync
, andUpdateAsync
) methods use undocumented mutually-exclusive parameters (e.g. When a method has bothDataSet dataset
ORDataTable datatable
as parameters, the runtime caller must provide arguments for only one, not both, parameters). There is also the crypticsrcTable
parameter in theUpdate
method. The official documentation does not aid in understanding what exactly it means when the source-code itself gives no clue.I was surprised to see that this repo only includes the most basic of unit-tests for
DbDataAdapter
[1] [2]. Surely Microsoft has the original thorough test suite forDbDataAdapter
somewhere? Can you bring it out of the archives and post it somewhere so the rest of us can use it to ensure our implementations are correct?[1] https://github.com/dotnet/runtime/blob/main/src/libraries/System.Data.Common/tests/System/Data/Common/DataAdapterTest.cs
[2] https://github.com/dotnet/runtime/blob/main/src/libraries/System.Data.Common/tests/System/Data/Common/DbDataAdapterTest.cs
Beta Was this translation helpful? Give feedback.
All reactions