feat: Require explicit container image in Testcontainers.Xunit#1612
Conversation
Follow-up to testcontainers#1584 When the parameterless constructors are actually removed 1. Remove the `new()` constraint on ContainerLifetime, ContainerFixture, ContainerTest, DbContainerFixture and DbContainerTest 2. Make ContainerFixture abstract 3. Change `protected virtual TBuilderEntity Configure() => new();` to `protected abstract TBuilderEntity Configure();` on ContainerLifetime 4. Delete the obsolete methods: `protected virtual TBuilderEntity Configure(TBuilderEntity builder)`
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughParameterless Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-11-17T17:58:43.958ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
HofmeisterAn
left a comment
There was a problem hiding this comment.
Looks good! Just a few small things to fix before we can merge it.
What does this PR do?
This pull request introduce a new parameterless
Configure()method on theContainerLifetimeclass, hence also on the derived(Db)ContainerFixtureand(Db)ContainerTestclasses.It also makes the
TBuilderEntity Configure(TBuilderEntity builder)method obsolete.Why is it important?
This matches the changes discussed in #1540 and introduced in #1584.
Related issues
This is a follow-up to #1584. Closes #1598.
/cc @digital88
How to test this PR
All relevant tests have been adapted to use the new parameterless
Configure()method.Follow-ups
When the parameterless constructors (now obsolete) are eventually removed from the builders, the following changes will need to be performed.
new()constraint onContainerLifetime,ContainerFixture,ContainerTest,DbContainerFixtureandDbContainerTestContainerFixtureclass abstractprotected virtual TBuilderEntity Configure() => new();toprotected abstract TBuilderEntity Configure();on ContainerLifetime, forcing consumers to provide the image name/tag when creating builders.protected virtual TBuilderEntity Configure(TBuilderEntity builder)Summary by CodeRabbit
Refactor
Bug Fixes
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.