-
-
Notifications
You must be signed in to change notification settings - Fork 18
start migrating tests to tunit #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…UrlToLicenseMapping.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
There was a problem hiding this 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
withConsole.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))] |
There was a problem hiding this comment.
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.
[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"); |
There was a problem hiding this comment.
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.
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.
No description provided.