Skip to content

start migrating tests to tunit#222

Merged
sensslen merged 3 commits into
mainfrom
simon/start-migrating-to-tunit
Aug 12, 2025
Merged

start migrating tests to tunit#222
sensslen merged 3 commits into
mainfrom
simon/start-migrating-to-tunit

Conversation

@sensslen
Copy link
Copy Markdown
Owner

No description provided.

@sensslen sensslen requested a review from Copilot August 12, 2025 07:31

This comment was marked as outdated.

sensslen and others added 2 commits August 12, 2025 09:32
…UrlToLicenseMapping.csproj

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sensslen sensslen requested a review from Copilot August 12, 2025 07:34
@sonarqubecloud
Copy link
Copy Markdown

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 migrates tests from NUnit to TUnit testing framework. The changes include updating test attributes, replacing NUnit-specific functionality with TUnit equivalents, and updating package dependencies.

  • Replaces NUnit test attributes ([TestFixture], [TestCaseSource], [NonParallelizable]) with TUnit equivalents ([Test], [MethodDataSource], [NotInParallel])
  • Updates package references to use TUnit instead of NUnit and related packages
  • Replaces TestContext.Out.WriteLineAsync with Console.WriteLine for test output

Reviewed Changes

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

File Description
UrlToLicenseMappingTest.cs Migrates test class from NUnit to TUnit attributes and replaces test output mechanism
NuGetUtility.Test.UrlToLicenseMapping.csproj Updates package references to replace NUnit packages with TUnit

[NonParallelizable]
[Test]
[MethodDataSource(typeof(UrlToLicenseMappingTestSource), nameof(UrlToLicenseMappingTestSource.GetDefaultMappings))]
[NotInParallel(nameof(License_Should_Be_Available_And_Match_Expected_License))]
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The [NotInParallel] attribute appears to be referencing the method itself. This creates a circular reference that may not work as intended. Consider using a shared resource name or removing the parameter if the intent is to prevent parallel execution of this specific test method.

Suggested change
[NotInParallel(nameof(License_Should_Be_Available_And_Match_Expected_License))]
[NotInParallel]

Copilot uses AI. Check for mistakes.
Console.WriteLine($"Failed to check license. Retry count: {retryCount}\n\n");
Console.WriteLine($"Error:");
Console.WriteLine(licenseResult.Error);
Console.WriteLine($"\n\nRetrying after {retryTimeout}ms\n\n");
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

Replacing TestContext.Out.WriteLineAsync with Console.WriteLine may result in test output not being captured by the test framework. Consider using TUnit's equivalent for test output to ensure proper integration with the testing framework.

Suggested change
Console.WriteLine($"\n\nRetrying after {retryTimeout}ms\n\n");
TestContext.WriteLine($"Failed to check license. Retry count: {retryCount}\n\n");
TestContext.WriteLine($"Error:");
TestContext.WriteLine(licenseResult.Error);
TestContext.WriteLine($"\n\nRetrying after {retryTimeout}ms\n\n");

Copilot uses AI. Check for mistakes.
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