Skip to content

test: add missing coverage tests (post-#391 — hooks, full param matrix, config models)#392

Merged
JusterZhu merged 2 commits into
masterfrom
test/missing-coverage-13b
May 24, 2026
Merged

test: add missing coverage tests (post-#391 — hooks, full param matrix, config models)#392
JusterZhu merged 2 commits into
masterfrom
test/missing-coverage-13b

Conversation

@JusterZhu
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #391. Three test files that missed the squash merge:

BootstrapFullParameterMatrixTests (55 tests)

ALL 42 UpdateOptions verified via .Option() + 6 combination chains including:

  • Chain_ClientAndUpgrade_BothFullyConfigured: Client + Upgrade dual 30+ options each, hooks, listeners, precheck
  • Chain_ClientAndUpgrade_CompleteDeveloperWorkflow: real-world developer 3-step flow

BootstrapHooksAndExtensionsTests (30 tests)

  • IUpdateHooks 5-method lifecycle + RejectingHooks
  • IUpdateReporter / UpdateReport / UpdateEvent (5 states)
  • IUpdateEventListener (8 event methods including OnProgress/OnCustomEvent)
  • NoOpUpdateHooks, UpdateContext/DownloadContext models
  • All 4 auth schemes configurability

ConfigurationModelsTests (35 tests)

  • BlackListConfig / HubConfig
  • DownloadAsset / DownloadPlan / DownloadProgress / DownloadResult
  • All 9 enum types (AppType, DiffMode, UpdateMode, PlatformType, OssProvider, DownloadStatus, DownloadPriority, UpdateEvent)
  • UpdateOption<T> value semantics (5 types)

Results

CoreTest: 288 pass, 3 pre-existing failures

Files that missed the #391 squash merge:
- BootstrapFullParameterMatrixTests: ALL 42 UpdateOptions, 6 chains
  including Client+Upgrade dual full-configuration
- BootstrapHooksAndExtensionsTests: IUpdateHooks lifecycle (5 methods),
  IUpdateReporter, IUpdateEventListener (8 events), security schemes
- ConfigurationModelsTests: BlackListConfig, HubConfig, DownloadAsset/Plan/
  Progress/Result, 9 enums, UpdateOption<T> semantics

Closes #390 (follow-up)
Copilot AI review requested due to automatic review settings May 24, 2026 15:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing CoreTest coverage that was intended as a follow-up to #391, focusing on bootstrapping option coverage, hooks/event extension points, and configuration/download model types.

Changes:

  • Added full UpdateOptions “parameter matrix” tests for GeneralUpdateBootstrap.Option(...) chaining scenarios.
  • Added tests for hooks lifecycle (IUpdateHooks), event listeners (IUpdateEventListener), and related models.
  • Added tests for configuration and download/reporting model types and enums.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/CoreTest/Configuration/ConfigurationModelsTests.cs Adds unit tests for configuration/download/reporting models and enum/value semantics.
tests/CoreTest/Bootstrap/BootstrapHooksAndExtensionsTests.cs Adds tests for hooks lifecycle, event listener interface usage, and bootstrap extension configuration.
tests/CoreTest/Bootstrap/BootstrapFullParameterMatrixTests.cs Adds broad UpdateOptions coverage via individual option tests and multi-option chain scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +14
/// Full parameter matrix tests �?verifies ALL UpdateOptions constants
/// can be set via .Option() without throwing. Covers 39 options across
Token = "token"
});

#region Core (9)
Comment on lines +372 to +376
listener.OnUpdateInfo(new UpdateInfoEventArgs(new VersionRespDTO { Code = 200 }));
listener.OnException(new ExceptionEventArgs(new Exception("test"), "test"));
listener.OnProgress(new ProgressEventArgs(new DownloadProgress("update.zip", 50L * 1024 * 1024, 100L * 1024 * 1024, 50.0, DownloadStatus.Downloading)));
listener.OnCustomEvent("test.event", EventArgs.Empty);

…rop region counts

- Remove OnCustomEvent from TestEventListener (only 7 IUpdateEventListener methods exist)
- Fix file header: 42 options -> 37 options (matches actual UpdateOptions surface)
- Remove hard-coded test counts from #region headers to prevent drift
- Fix garbled characters in comments
@JusterZhu JusterZhu merged commit ccd7f6b into master May 24, 2026
3 checks passed
@JusterZhu JusterZhu deleted the test/missing-coverage-13b branch May 24, 2026 16:00
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