Skip to content

Consolidate reusable test utilities in SimpleModule.Tests.Shared#104

Merged
antosubash merged 3 commits intomainfrom
claude/move-test-utilities-shared-MfCbR
Apr 11, 2026
Merged

Consolidate reusable test utilities in SimpleModule.Tests.Shared#104
antosubash merged 3 commits intomainfrom
claude/move-test-utilities-shared-MfCbR

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Move InMemoryStorageProvider out of SimpleModule.FileStorage.Tests and
rename it to InMemoryStorage under SimpleModule.Tests.Shared so any test
project that needs an in-memory IStorageProvider can reuse it without
copying the class. Update FileStorageServiceTests to use the shared type.

Add FakeJobExecutionContext in SimpleModule.Tests.Shared. It implements
IJobExecutionContext (public contract) and captures progress reports and
log messages in-memory so tests can assert on job behavior without
constructing a ProgressChannel or the internal DefaultJobExecutionContext.

Add TestDatasetsDbContext in SimpleModule.Tests.Shared. It is a sealed
subclass of DatasetsDbContext with a static Create() factory that owns a
private in-memory SQLite connection and disposes it with the context.

No change to the BackgroundJobs InternalsVisibleTo attribute: the new
utilities only depend on public contract types.

claude and others added 2 commits April 11, 2026 14:49
Move InMemoryStorageProvider out of SimpleModule.FileStorage.Tests and
rename it to InMemoryStorage under SimpleModule.Tests.Shared so any test
project that needs an in-memory IStorageProvider can reuse it without
copying the class. Update FileStorageServiceTests to use the shared type.

Add FakeJobExecutionContext in SimpleModule.Tests.Shared. It implements
IJobExecutionContext (public contract) and captures progress reports and
log messages in-memory so tests can assert on job behavior without
constructing a ProgressChannel or the internal DefaultJobExecutionContext.

Add TestDatasetsDbContext in SimpleModule.Tests.Shared. It is a sealed
subclass of DatasetsDbContext with a static Create() factory that owns a
private in-memory SQLite connection and disposes it with the context.

No change to the BackgroundJobs InternalsVisibleTo attribute: the new
utilities only depend on public contract types.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 11, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 71a2ef9
Status: ✅  Deploy successful!
Preview URL: https://deab9cd4.simplemodule-website.pages.dev
Branch Preview URL: https://claude-move-test-utilities-s.simplemodule-website.pages.dev

View logs

@antosubash antosubash merged commit 8f01bd3 into main Apr 11, 2026
5 checks passed
@antosubash antosubash deleted the claude/move-test-utilities-shared-MfCbR branch April 11, 2026 20:39
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.

2 participants