Commit caa9e0f
test: repoint relational unit tests to new read/purge semantics
The initial commit removed the EnableHistory guard from the relational
read/purge handlers but missed four unit tests in
DotNetWorkQueue.Transport.RelationalDatabase.Tests that still asserted
the old behavior ("factory.DidNotReceive().Create()" when
EnableHistory=false). Convert them to assert the new behavior: when the
history table does not exist (simulated via DbException), the handlers
return empty / null / 0 gracefully.
- Get_When_Disabled_Returns_Empty_List -> Get_When_History_Table_Missing_Returns_Empty_List
- GetByQueueId_When_Disabled_Returns_Null -> GetByQueueId_When_History_Table_Missing_Returns_Null
- GetCount_When_Disabled_Returns_Zero -> GetCount_When_History_Table_Missing_Returns_Zero
- Purge_When_Disabled_Returns_Zero -> Purge_When_History_Table_Missing_Returns_Zero
216/216 tests pass locally.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d991b3c commit caa9e0f
2 files changed
Lines changed: 43 additions & 12 deletions
File tree
- Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic
Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/PurgeMessageHistoryHandlerTests.cs
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
| 24 | + | |
17 | 25 | | |
18 | | - | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
71 | 83 | | |
72 | 84 | | |
Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/QueryMessageHistoryHandlerTests.cs
Lines changed: 28 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | | - | |
| 18 | + | |
14 | 19 | | |
15 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
| 25 | + | |
17 | 26 | | |
18 | | - | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
22 | | - | |
| 30 | + | |
23 | 31 | | |
24 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
25 | 36 | | |
| 37 | + | |
26 | 38 | | |
27 | | - | |
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
31 | | - | |
| 42 | + | |
32 | 43 | | |
33 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
34 | 48 | | |
| 49 | + | |
35 | 50 | | |
36 | | - | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
| |||
122 | 136 | | |
123 | 137 | | |
124 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
125 | 144 | | |
126 | 145 | | |
0 commit comments