Commit cf82311
committed
Consume the lifted JasperFx.Events ProjectionScenario
Closes #404. Deletes Polecat's seven-file copy of Marten's pre-lift harness and
replaces it with one subclass of
JasperFx.Events.TestSupport.ProjectionScenario<TOperations, TQuerySession>
(jasperfx#616, shipped in JasperFx.Events 2.38.0), closed over Polecat's
IDocumentSession / IQuerySession. Marten's equivalent adoption is marten#5133.
Nearly free, as #404 predicted: all seven abstract seam members already existed
as PolecatComplianceFixture bodies, because that seam was deliberately shaped to
match EventStoreComplianceFixture -- including the object-id load dispatch.
What Polecat gets that its own copy never had:
- The 15 missing overloads exist, inherited rather than written. The one that
actually bit was IEnumerable<object>: a caller holding a List<object> had to
spread it at every call site.
- An arrange-only scenario is no longer a silent no-op. Appends only flushed when
the next step was an assertion, so a trailing append was disposed uncommitted
(marten#5126).
- A failed action stops the scenario instead of letting later steps run against
state nobody intended; failed assertions still accumulate and report together.
- A scenario can only execute once, Timeout is configurable, and the
CancellationToken is honored.
- DoNotDeleteExistingData -> DeleteExistingData (default true), Execute ->
ExecuteAsync, and DocumentShouldExist/NotExist take object ids.
Two things this change does beyond the swap:
AdvancedOperations.CleanAsync gains a non-generic Type overload and the generic
one now delegates to it. DeleteExistingDataAsync has to reset each projection's
Options.StorageTypes, which are Types, and the alternative -- CleanAllDocumentsAsync
-- would take out documents a scenario deliberately seeded first. It also removes
the last ad-hoc SqlConnection in this file: the old harness cleaned projected
documents on a hand-opened connection, outside StoreOptions.ResiliencePipeline.
Six tests added beside the five that already existed, covering the seam rather
than re-testing scripting behavior jasperfx#616 already unit-tests against a fake
store: the IEnumerable overload, a string stream key through the object-id load
dispatch, the trailing-append commit rule, the re-execution guard,
DeleteExistingData = false, and an async-lifecycle projection that can only pass
if BuildDaemonAsync really stood up a daemon and the scenario waited on it.
projection_scenario_tests 11/11.1 parent 0414f2d commit cf82311
9 files changed
Lines changed: 236 additions & 430 deletions
File tree
- src
- Polecat.Tests/Events
- Polecat
- Events/TestSupport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
19 | 32 | | |
20 | 33 | | |
21 | 34 | | |
| |||
140 | 153 | | |
141 | 154 | | |
142 | 155 | | |
143 | | - | |
| 156 | + | |
144 | 157 | | |
145 | 158 | | |
146 | 159 | | |
| |||
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
152 | 327 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
496 | 507 | | |
497 | | - | |
| 508 | + | |
498 | 509 | | |
499 | 510 | | |
500 | 511 | | |
| |||
683 | 694 | | |
684 | 695 | | |
685 | 696 | | |
686 | | - | |
| 697 | + | |
687 | 698 | | |
688 | 699 | | |
689 | 700 | | |
| |||
Lines changed: 0 additions & 120 deletions
This file was deleted.
0 commit comments