Draft: TUnit Example#4065
Conversation
|
Oh, thanks for this. It's certainly more concrete. I need to let @lillo42 finish his generated tests, because it's hard to hit a moving target, but we could certainly think about this after that. |
635350a to
c76d53c
Compare
|
@iancooper — question about
contentType.CharSet = message.Header.ContentType?.CharSet ?? CharacterEncoding.UTF8.FromCharacterEncoding();Sync The compressed payload is binary (stored as This was invisible until commit c76d53c switched a sync-origin test from Two reasonable directions here — which do you want?
Happy to flip to (2) if you'd rather preserve the existing on-the-wire format. |
0cd2522 to
26f2436
Compare
f3d83ea to
55b449d
Compare
55b449d to
f4f176e
Compare
8de8938 to
48560b0
Compare
ae913fc to
79f36bf
Compare
4a2aa51 to
e1102c7
Compare
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Failed
Prevent hotspot decline
(1 hotspot with Low Cohesion)
Enforce critical code health rules
(1 file with Low Cohesion)
Enforce advisory code health rules
(1 file with Code Duplication)
Gates Passed
1 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Prevent hotspot decline | Violations | Code Health Impact | |
|---|---|---|---|
| RedisMessageConsumer.cs | 1 rule in this hotspot | 6.72 → 6.33 | Suppress |
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| RedisMessageConsumer.cs | 1 critical rule | 6.72 → 6.33 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| CompressPayloadTransformer.cs | 1 advisory rule | 8.82 → 8.55 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| RedisMessageProducer.cs | 9.39 → 10.00 | Code Duplication |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
e1102c7 to
5d3ba07
Compare
5d3ba07 to
8acd98a
Compare
Use ordered collection equivalence instead of reference equality. Restore the omitted CloudEvents content-type argument.
Use unique closed generic types per scenario so tests exercise public pipeline behavior without clearing or inspecting shared caches.
Use unique routing keys and dispose trace providers so each test observes only spans emitted by its own message flow.
Use value-based collection assertions and isolate the PostgreSQL test that controls the public migration history table.

You mentioned last week that you wondered if TUnit was worth switching to - So thought I'd just do a draft branch to show you what Brighter would look like switched over.
Might be useful to see if test speeds improve or anything. I attempted to enable parallelisation by having tests use unique topic names, or queue names, etc. to better support test isolation. (Though I don't know if limited CI constraints will fight against more parallelisation!)
Don't feel obliged to adopt it or anything, just thought it'd be a bit more useful to see it in something more tangible.