start migrating tests to tunit#222
Conversation
…UrlToLicenseMapping.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
There was a problem hiding this comment.
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.WriteLineAsyncwithConsole.WriteLinefor 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))] |
There was a problem hiding this comment.
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.
| [NotInParallel(nameof(License_Should_Be_Available_And_Match_Expected_License))] | |
| [NotInParallel] |
| 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"); |
There was a problem hiding this comment.
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.
| 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"); |



No description provided.