Skip to content

Conversation

@nmummau
Copy link
Contributor

@nmummau nmummau commented Oct 18, 2025

…and adopt Assert.ThrowsExactly; update test SDK

  • Update dev test deps:
    • Microsoft.NET.Test.Sdk: 17.14.1 → 18.0.0
    • MSTest.TestAdapter: 3.9.3 → 4.0.1
    • MSTest.TestFramework: 3.9.3 → 4.0.1
  • Replace Assert.ThrowsException → Assert.ThrowsExactly where exact type is required
  • Remove unused using Microsoft.SqlServer.Management.HadrModel;

Rationale: MSTest v4 removes deprecated ThrowsException APIs; tests updated in lockstep with package upgrades to keep the build passing.

Also fixed a failing test.

…date test SDK

- Update dev test deps:
  - Microsoft.NET.Test.Sdk: 17.14.1 → 18.0.0
  - MSTest.TestAdapter: 3.9.3 → 4.0.1
  - MSTest.TestFramework: 3.9.3 → 4.0.1
- Replace Assert.ThrowsException<T> → Assert.ThrowsExactly<T> where exact type is required
- Remove unused `using Microsoft.SqlServer.Management.HadrModel;`

Rationale: MSTest v4 removes deprecated *ThrowsException* APIs; tests updated in lockstep with package upgrades to keep the build passing.
@ErikEJ ErikEJ requested a review from Copilot October 18, 2025 12:54
Copy link

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

Migrates test project to MSTest v4 and updates assertions to use the new Assert.ThrowsExactly API.

  • Upgrade Microsoft.NET.Test.Sdk and MSTest packages to specified newer versions.
  • Replace Assert.ThrowsException with Assert.ThrowsExactly in tests where exact exception type matching is desired.
  • No functional production code changes; only test infrastructure and assertion semantics updated.

Reviewed Changes

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

File Description
test/DacpacTool.Tests/ScriptParserTests.cs Updated assertion to Assert.ThrowsExactly for precise exception type matching.
test/DacpacTool.Tests/PackageBuilderTests.cs Switched to Assert.ThrowsExactly to enforce non-polymorphic exception expectation.
test/DacpacTool.Tests/DacpacTool.Tests.csproj Bumped test SDK and MSTest framework/adapter package versions to v4-compatible releases.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ErikEJ
Copy link
Collaborator

ErikEJ commented Oct 18, 2025

@nmummau We have a flaky test, could you change

stopWatch.ElapsedMilliseconds.ShouldBeLessThan(20);

to

stopWatch.ElapsedMilliseconds.ShouldBeLessThan(30);

In VersionChekertest ?

The test `RunsVersionCheck` previously asserted that the cached
version check must complete in under 20 ms. This tight bound caused
intermittent failures in slower environments (e.g. CI).

Increase the threshold to 30 ms to make the test more robust while
still verifying the caching behavior.
Copy link
Member

@jmezach jmezach left a comment

Choose a reason for hiding this comment

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

LGTM

@jmezach jmezach merged commit 651bf51 into rr-wfm:master Oct 20, 2025
13 checks passed
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.

3 participants