Skip to content

chore(bunit): bump version 2.0#703

Merged
ArgoZhang merged 1 commit intomasterfrom
test-buint
Nov 16, 2025
Merged

chore(bunit): bump version 2.0#703
ArgoZhang merged 1 commit intomasterfrom
test-buint

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Nov 16, 2025

Link issues

fixes #702

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Migrate unit tests to bUnit v2 API, update test expectations, refresh file headers, and bump the project version to 2.0.

Enhancements:

  • Upgrade testing framework to bUnit v2.0 and migrate tests to the new API

Tests:

  • Update editor tests to use Context.Render and cut.Render methods
  • Adjust region service test to expect a single city for Beijing

Chores:

  • Bump project version to 2.0
  • Refresh copyright headers to BootstrapBlazor & Argo Zhang

Copilot AI review requested due to automatic review settings November 16, 2025 02:59
@bb-auto bb-auto Bot added the test label Nov 16, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Nov 16, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Nov 16, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR upgrades Bunit to v2.0 by adapting test projects to the new BunitContext API, replacing deprecated rendering methods, and applying related test adjustments.

File-Level Changes

Change Details Files
Updated test context to BunitContext
  • Replaced TestContext with BunitContext
  • Adjusted Context property type and constructor setup
test/UnitTestEditor/BootstrapBlazorTestBase.cs
Replaced deprecated rendering methods
  • Swapped RenderComponent calls for Render
  • Replaced SetParametersAndRender invocations with Render
test/UnitTestEditor/EditorTest.cs
Adjusted region service test assertion
  • Changed Assert.Empty to Assert.Single for city count
test/UnitTestRegion/ServiceTest.cs
Updated copyright headers
  • Prefixed with “BootstrapBlazor &”
  • Changed author email address
test/UnitTestEditor/EditorTest.cs
test/UnitTestEditor/BootstrapBlazorTestBase.cs
test/UnitTestRegion/ServiceTest.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#702 Bump bunit test framework to version 2.* in unit tests.
#702 Improve code coverage for unit tests. The PR only updates the bunit test framework version and related code to use new APIs, but does not add new tests or increase code coverage.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit 4eae11b into master Nov 16, 2025
6 checks passed
@ArgoZhang ArgoZhang deleted the test-buint branch November 16, 2025 03:00
Copy link
Copy Markdown

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

This PR upgrades the bunit testing library from version 1.x to 2.0, updating the test infrastructure and fixing a test assertion bug that was uncovered during the migration.

  • Updates bunit dependency to version 2.*
  • Migrates all test code to use bunit 2.0 API
  • Fixes incorrect test assertion for Beijing municipality cities

Reviewed Changes

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

File Description
test/UnitTestEditor/BootstrapBlazorTestBase.cs Updated copyright header and migrated from TestContext to BunitContext for bunit 2.0 compatibility
test/UnitTestEditor/EditorTest.cs Updated copyright header and migrated from RenderComponent to Render and SetParametersAndRender to Render for bunit 2.0 API
test/UnitTestRegion/ServiceTest.cs Updated copyright header and fixed test assertion from Assert.Empty to Assert.Single for Beijing cities (correct behavior for municipality)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(bunit): bump vesion 2.*

2 participants