Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Conversation

@denscollo
Copy link
Contributor

@denscollo denscollo commented Sep 4, 2020

Fixes #4088

Description

This PR migrates all Microsoft.Bot.Builder.AI.QnA.Tests project from MSTest to xUnit.

Specific Changes

  • Replaced MSTest packages with xUnit in the .csproj.
  • Replaced [TestMethod] with [Fact].
  • Replaced [TestCategory] with [Trait].
  • Changed Asserts
  • QnAMakerRecognizerTests:
    • Created new class QnAMakerRecognizerFixture to implement IClassFixture for share code.
    • Replaced ClassInitialize with IClassFixture to share ResourceExplorer within tests.
    • Added testName argument to CreateFlow method to replace the TestContext.TestName MSTest feature.
  • QnAMakerTests:
    • Added testName argument to CreateFlow method to replace the TestContext.TestName MSTest feature.
    • Removed unreachable code in QnaMaker_V2LegacyEndpoint_ConvertsToHaveIdPropertyInResult and renamed it as QnaMaker_V2LegacyEndpoint_Should_Throw
    • Removed unreachable code in QnaMaker_V3LegacyEndpoint_ConvertsToHaveIdPropertyInResult and renamed it as QnaMaker_V3LegacyEndpoint_Should_Throw
  • Startup:
    • Replaced [AssemblyInitialize] with AssemblyFixture.
  • Removed unused variables.
  • Use constants instead of variables where applicable.
  • Removed redundant parenthesis.

Testing

The following image shows the tests passing after the changes.
image

@denscollo denscollo requested a review from a team as a code owner September 4, 2020 13:26
@denscollo denscollo changed the title Migrate Microsoft.Bot.Builder.AI.QnA.Tests to xUnit [#4088] Migrate Microsoft.Bot.Builder.AI.QnA.Tests to xUnit Sep 11, 2020
@mrivera-ms mrivera-ms merged commit 46a68ab into microsoft:main Sep 14, 2020
@sw-joelmut sw-joelmut deleted the southworks/update/xunit-migration/qna-maker-tests branch November 24, 2020 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate botbuilder.ai.qna to xunit

4 participants