-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix DateOnly / TimeOnly parameters is TestCaseUsage #821
base: master
Are you sure you want to change the base?
Conversation
src/nunit.analyzers/ConstraintUsage/EqualConstraintUsageCodeFix.cs
Outdated
Show resolved
Hide resolved
new() | ||
{ | ||
(typeof(bool), new Lazy<TypeConverter>(() => new BooleanConverter())), |
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.
Updated mapping per TypeConverter updates:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs#L154
Had to update it to string from Type, as netstandard2.0 does not have DateTime/DateOnly/etc types.
@@ -12,7 +12,6 @@ | |||
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="all" /> | |||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" /> | |||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.11.0" /> | |||
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" /> |
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.
This package is not needed on netstandard2.0
Appveyor build failed, but I'm not really fure why: |
My time is very limited today due to new year's eve, but perhaps this is related to the cake tool? At least the bump to version 5.0 fails with
So perhaps bumping the cake tool will solve the problem (I've not checked if there are any breaking changes between 3.2.0 and 5.0.0. Perhaps bumping to version 4 will be enough? |
@Dreamescaper Sorry about the WIP and moving the PR to draft and back again. I was hoping that this was enough to retrigger the builds. I've updated cake to version 4 on master and I hope this is enough to solve the problem with AppVeyor |
@mikkelbu |
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 changes look sound @Dreamescaper. I'm a bit unsure why we need the bump to .NET8 as DateOnly and TimeOnly were already part of .NET 6, but I think I might be missing something obvious :).
Not that I've against the bump - I just thought from #677 that it would require update of the Roslyn Analyzer as well as larger consequential changes.
I've approved it, but I would prefer if @manfred-brands can take a second look before we merge this as I think he has a better understanding of the bump than I have (also I would like to test the generated nuget package locally).
Ooops. My bad. I don't know why I decided that I need to update to NET8. |
8db616c
to
8cc9968
Compare
8cc9968
to
fc1f568
Compare
Fixes #820 .
I had to update test project to use net8.0 here (to be able to actually test DateOnly / TimeOnly parameters), hope it's ok.