スキル一覧に戻る
manx

unit-test-specialist

by manx

0🍴 0📅 2025年12月8日
GitHubで見るManusで実行

SKILL.md


name: unit-test-specialist description: Expert guidance on unit testing for the Pomodoro Time Tracker. Activates when working with tests, test coverage, or testable code patterns. allowed-tools:

  • Read
  • Glob
  • Grep

Unit Test Specialist

Activates when: Tests, unit tests, test coverage, or testable code mentioned.

Shared Testing Guidelines

@/.claude/prompts/dotnet/testing/aaa-pattern.md @/.claude/prompts/dotnet/testing/test-naming.md @/.claude/prompts/dotnet/testing/moq-cheatsheet.md @/.claude/prompts/dotnet/testing/fluentassertions.md


Project-Specific

Framework Stack

  • xUnit - Primary test framework (.NET 9)
  • Moq - Mocking for interfaces
  • FluentAssertions - Readable assertions
  • EF Core InMemory - Repository testing

Test Structure (377 tests)

PomodoroTimeTracker.Tests/
├── ViewModels/                    (158 tests)
│   ├── PomodoroViewModelTests.cs     (60)
│   ├── RegularTimerViewModelTests.cs (40)
│   ├── StopWatchViewModelTests.cs    (30)
│   └── ...
├── Application/Services/          (148 tests)
│   ├── PomodoroSessionServiceTests.cs
│   ├── AudioServiceTests.cs          (35)
│   └── ...
└── Infrastructure/Repositories/   (71 tests)

ViewModel Test Pattern

public class ViewModelTests
{
    private readonly Mock<IService> _service;
    private readonly Mock<IDispatcherTimer> _timer;
    private readonly ViewModel _viewModel;

    public ViewModelTests()
    {
        _service = new Mock<IService>();
        _timer = new Mock<IDispatcherTimer>();
        _viewModel = new ViewModel(_service.Object, _timer.Object);
    }

    [Fact]
    public void Property_WhenChanged_UpdatesDependentProperties()
    {
        // Arrange
        var propertyChanges = new List<string>();
        _viewModel.PropertyChanged += (s, e) => propertyChanges.Add(e.PropertyName!);

        // Act
        _viewModel.SomeProperty = "value";

        // Assert
        propertyChanges.Should().Contain("DependentProperty");
    }
}

Service Test Pattern

public class ServiceTests : IDisposable
{
    private readonly ApplicationDbContext _context;
    private readonly Service _service;

    public ServiceTests()
    {
        var options = new DbContextOptionsBuilder<ApplicationDbContext>()
            .UseInMemoryDatabase(Guid.NewGuid().ToString())
            .Options;
        _context = new ApplicationDbContext(options);
        _service = new Service(new UnitOfWork(_context));
    }

    public void Dispose()
    {
        _context.Database.EnsureDeleted();
        _context.Dispose();
    }
}

Coverage Targets

  • 5-8 tests per public method
  • Happy path + validation + edge cases
  • 100% pass rate required

Update TEST_SUMMARY.md

When tests are added/modified, update TEST_SUMMARY.md with current counts.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です