Giter Club home page Giter Club logo

Comments (7)

OsirisTerje avatar OsirisTerje commented on June 9, 2024

They are still there, just under a name ClassicAssert. And if you want that to use the Assert, you can actually change that yourself using an alias, ref Using global using aliases, either as a global alias in the GlobalUsings.cs file, or directly in the csproj file.

global using Assert = NUnit.Framework.Legacy.ClassicAssert;

or in the csproj

<Using Include="NUnit.Framework.Legacy.ClassicAssert" Alias="Assert" />

You can then still use the That syntax if you like, in some cases.

We have no intention of removing these, but I assume you have read that we can't evolve the classic asserts the way we can with the constraint aliases.

from nunit.

MgSam avatar MgSam commented on June 9, 2024

Why rename them though and break everyone who upgrades?

from nunit.

OsirisTerje avatar OsirisTerje commented on June 9, 2024

We had to move them into a separate project.
We also considered moving it into its own project, but that is now on ice. But splitting out all assertions, including constraints, into their own packages does have merit.
And when it is in its own project, we can't have the same class name.

If C# had allowed extension methods on static classes (which have been discussed for one, and also here ), we could have solved it that way.

Also, this is a version 4, it does come with breaking changes, and that's also why we have a Migration Guide.

from nunit.

renemadsen avatar renemadsen commented on June 9, 2024

@OsirisTerje

Also, this is a version 4, it does come with breaking changes, and that's also why we have a Migration Guide.

According to the migration guide it states: "The analyzer code fix supports Batch Fixing:"

But how is that done and can it be done from cli?

I'm using Rider and can only do one line at a time, which is a problem, when you have 10k+ lines that needs to be converted to the new format.

from nunit.

manfred-brands avatar manfred-brands commented on June 9, 2024

Within Visual Studio you can apply a CodeFix to either a Document, a Project or a Solution.

An issue for Rider has been open for years.

It might be that dotnet format work on the command line, but I haven't tried it. See dotnet/roslyn#48561

from nunit.

stevenaw avatar stevenaw commented on June 9, 2024

@renemadsen
Are you on .NET6+ by chance? The link shared by @manfred-brands also includes a suggestion for something like this from CLI (though I have not tried it myself)

EDIT: Oops. I see the original comment had already been updated to reflect that

dotnet format analyzers --diagnostics=DIAG_ID_TO_FIX

from nunit.

OsirisTerje avatar OsirisTerje commented on June 9, 2024

Perhaps this can fix these things for us: https://devblogs.microsoft.com/dotnet/dotnet-build-2024-announcements/#c-13 - Extension types.

from nunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.