Add UseDummyData extension for SQLite in-memory test blog posts#472
Merged
linkdotnet merged 1 commit intomasterfrom Dec 26, 2025
Merged
Add UseDummyData extension for SQLite in-memory test blog posts#472linkdotnet merged 1 commit intomasterfrom
linkdotnet merged 1 commit intomasterfrom
Conversation
Copilot
AI
changed the title
[WIP] Add method to load test blog posts for development
Add UseDummyData extension for in-memory test blog posts
Dec 26, 2025
Owner
|
@copilot 1. Remove the tests |
Contributor
Author
Done in commit 6b36075. The implementation now:
The refactored code uses |
Copilot
AI
changed the title
Add UseDummyData extension for in-memory test blog posts
Add UseDummyData extension for SQLite in-memory test blog posts
Dec 26, 2025
6b36075 to
da256f2
Compare
da256f2 to
9137bb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Developers need pre-populated blog posts to test pagination, navigation, and search without manual data entry. In-memory SQLite loses data on restart, making this particularly painful during feature development.
Changes
DummyDataOptions: Configurable number of blog posts (default: 20)DummyDataSeeder: Hosted service that seeds test data on startup with realistic titles, tags, dates, and contentUseDummyData()extension: Uses SQLite in-memory database with the existing SQLRepository<>implementationProgram.cswhenIsDevelopment()Implementation
Uses SQLite in-memory with shared cache (
DataSource=file::memory:?cache=shared) and the existingRepository<>fromLinkDotNet.Blog.Infrastructure.Persistence.Sql. Data is seeded via a hosted service on application startup.Usage
Called after
AddStorageProvider()in the service registration chain - removes existingIRepository<>registrations and sets up SQLite in-memory with the SQL repository.Screenshot
20 blog posts with realistic titles, descriptions, tags, and dates. Fixed random seed ensures reproducible test data across sessions.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.