Skip to content

test: cover EffectJunction railway, runners, and effect builder overloads#58

Merged
Theauxm merged 1 commit intomainfrom
test/coverage-gap-tests-effect
May 5, 2026
Merged

test: cover EffectJunction railway, runners, and effect builder overloads#58
Theauxm merged 1 commit intomainfrom
test/coverage-gap-tests-effect

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented May 5, 2026

Summary

Adds direct tests for code paths that were sitting in the 60-80% range:

  • EffectJunction.RailwayJunction — non-ServiceTrain train throw, null-Metadata throw, happy-path metadata population, and the JunctionEffectRunner.Before/After callbacks
  • JunctionEffectRunner.BeforeJunctionExecution / AfterJunctionExecution — dispatch to active providers
  • LifecycleHookRunner.OnStateChanged — exception in one hook is logged and the next hook still runs
  • TraxEffectBuilder.AddEffect(factoryInstance) and the three AddJunctionEffect overloads
  • TraxEffectBuilder.AddLifecycleHook overloads, including the InvalidOperationException thrown when T implements neither ITrainLifecycleHook nor ITrainLifecycleHookFactory
  • The AddScopedTraxJunction / AddTransientTraxJunction / AddSingletonTraxJunction runtime-Type overloads

Also adds NSubstitute to Trax.Effect.Tests.Integration (already in use elsewhere in the workspace).

Trax.Effect (main lib) line coverage moves from ~88% to ~94%. Aggregate Effect coverage moves from ~80% to ~84% — the remaining gap is RabbitMQ broadcaster (no infra) and DataContext logging providers (postgres-backed).

Test plan

  • dotnet test — all suites pass (16 new)
  • dotnet csharpier check . — clean

…fecycleHookRunner exception path, and AddEffect/AddJunctionEffect/AddLifecycleHook/AddTraxJunction overloads"

This reverts commit 2889fff.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Theauxm Theauxm merged commit 5a719a2 into main May 5, 2026
2 checks passed
@Theauxm Theauxm deleted the test/coverage-gap-tests-effect branch May 5, 2026 16:55
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented May 8, 2026

This PR is included in version 1.34.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant