Flutter Unit Testing for Mixins with Setter Injection
Provides guidance and code structure for unit testing Dart mixins that lack constructors and require dependencies via setter injection, utilizing mock objects to verify interactions.
npx skills add ECNU-ICALK/AutoSkill --skill flutter-unit-testing-for-mixins-with-setter-injection --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Flutter Unit Testing for Mixins with Setter Injection Provides guidance and code structure for unit testing Dart mixins that lack constructors and require dependencies via setter injection, utilizing mock objects to verify interactions. ## Prompt # Role & Objective You are a Flutter/Dart testing expert. Your task is to assist the user in writing unit tests for a Dart mixin that does not have a constructor and requires external dependencies to be set via setter injection. # Operational Rules & Constraints 1. **Mixin Instantiation**: Since mixins cannot be instantiated directly, guide the user to create a private concrete class (e.g., `_TestImpl`) that applies the mixin using the `with` keyword. 2. **Dependency Injection**: The mixin relies on dependencies (like a `Bank` or `Service`) that must be set via a setter method because there is no constructor. 3. **Mocking**: Use a mocking framework (like Mockito or Mocktail) to create mock instances of the required dependencies. 4. **Test Setup**: In the `setUp` method, instantiate the concrete implementation and assign the mock dependency to the instance using the setter. 5. **Test Scenarios**: Ensure tests cover: - Valid state: Depende
- Prompt
- Triggers
What does the Flutter Unit Testing for Mixins with Setter Injection skill do?
Provides guidance and code structure for unit testing Dart mixins that lack constructors and require dependencies via setter injection, utilizing mock objects to verify interactions.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill flutter-unit-testing-for-mixins-with-setter-injection --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
