@bradwilson@mastodon.social
@bradwilson@mastodon.social avatar

bradwilson

@bradwilson@mastodon.social

#Code #Motorcycles #Music #BoardGames #VideoGames #Photography #AntiFascist #AntiRacist #PostTheist #Feminist #EV #GreenEnergy #BlackLivesMatter | https://dotnet.social/@xunit's caretaker | He/him | 0.00115 miles tall

Previously: GitHub, Microsoft, and others.
Now: Living that retired life.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

bradwilson, (edited ) to dotnet
@bradwilson@mastodon.social avatar

This is super duper extra important.

C# Nullable Reference Types are a compile-time thing, not a runtime thing. "string?" and "string" are both just "string" at runtime.

This means:

  • Always guard against your users passing null even for types that shouldn't allow it, because it's not a runtime guarantee.

  • You can't create overloads that differ only on nullability (i.e., Method(string) vs. Method(string?)) because they're the same type at runtime.

#dotnet #csharp #nullable #nrt

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Alright, time to see what's broken in the @xunit projects by .NET SDK 8. Expecting new analyzers with issues for me to fix, mostly. #dotnet

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Putting together another @xunit 2.5.0 prerelease build today.

Spent a few hours yesterday picking through very old issues (focused on uncategorized), to see if there was anything important missing before I ship a new build. I was able to close a bunch of stuff as either already fixed or no longer relevant, and categorized a bunch more.

Here are the two issue lists I consult most:

Core: https://github.com/xunit/xunit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
VS: https://github.com/xunit/visualstudio.xunit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

#dotnet #csharp #tdd #unittest #foss #oss

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Upgrading to .NET 8 breaks the dotnet tool version of PowerShell 7. Re-installation doesn't help. 😞

Moving to installation via WinGet made it work again.

#dotnet #PowerShell

bradwilson, to random
@bradwilson@mastodon.social avatar

The @xunit assertion library overhaul is (mostly*) done. Updated messages, all exception types moved to factory and partials, updated ArgumentFormatter (to not print unsafe enumerables). It's been pushed into the v2 branch and the main branch.

I've also bumped the v2 version to 2.5.0 in anticipation of the new release. Builds will be on MyGet as usual: https://myget.org/gallery/xunit

  • = I have double-enumeration stuff to fix still, as well as fixing Assert.Equivalent based on my poll.
bradwilson, (edited ) to dotnet
@bradwilson@mastodon.social avatar

Sad realization for today: using formatted strings hides issues that CA1305 would find.

Overly simple example:

$"{myValue}"

vs.

myValue.ToString()

These are equivalent. Both (usually) implicitly and silently use CultureInfo.CurrentUICulture, but only the latter can be flagged as needing an explicit culture to ensure you're getting the value the way you want.

This kind of makes me want to rip out all instances of formatted strings now.

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Does anybody know if you can debug .NET Framework code in VS Code on Windows?

I currently use the "coreclr" and "mono" launch types in launch.json to debug .NET and Mono on non-Windows machines. Is there an equivalent launch type for .NET Framework on Windows?

I'm guessing no, since this is the drop-down I see when I click "Run and Debug" on a console project targeting net472.

#dotnet #vscode #csharp #csharpDevKit

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Anybody else using C# Dev Kit on VS Code seeing this error?

#dotnet #csharp #csharpDevKit #vscode

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

What is the point of CA1002 ("Do Not Expose Generic Lists")? https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1002

The justification talks about List<T> being "designed for performance, not inheritance". I feel like that's precisely why I want to return List<T>. Why shouldn't I just turn this rule off? Alternatively, what's the value in returning IList<T> here? Because I might want to return a non-List<T> list at some point? That feels YAGNI-ish.

#dotnet #csharp

bradwilson, to random
@bradwilson@mastodon.social avatar

The contents of my brain are 50% song lyrics, 40% movie quotes, 10% coding trivia, and 0% people's names. #SorryIForgotYourName #ButSomeoneHasToRememberTheWordsToThisSong #YouKnowItsSadButTrue

bradwilson, to random
@bradwilson@mastodon.social avatar

There will be an @xunit release this week (primarily for analyzers but also including the core framework). If there are things you want in it, get them reported ASAP.

bradwilson, (edited ) to random
@bradwilson@mastodon.social avatar

If you're coming to Microsoft Build in Seattle this week, I'll be there. I can be bribed primarily with brown liquor, but good food is a close second. You know, if there's some key feature you want in @xunit or whatever. 😉

Oh, and I'll have stickers with me.

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

This was an interesting bug reported against @xunit:

"I have a project with several tests inside using some tasks. These unit tests are running well on my PC (Windows 10 Pro with a CPU with 14 cores and 20 logical cores). But when I am executing the same Units test on Azure DevOps machine, some tests are failing."

Turns out this wasn't a testing problem at all, but a race condition involving the thread pool. See my response on the discussion: https://github.com/xunit/xunit/discussions/2797

#dotnet #csharp

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

I'm shipping binaries compiled against netstandard1.1 and the NuGet reference I bring along is NETStandard.Library version 1.6.1.

Does anybody know any reason I can't just bump that up to version 2.0.3? It seems like it's just a more complete collection of dependencies for runtime.

#dotnet #nuget

bradwilson, to random
@bradwilson@mastodon.social avatar

Feels like fall here. Time to pick up some apple cider and cranberry juice on my next grocery trip so I can make a @thurrott #cocktail or three.

image/jpeg
image/jpeg

bradwilson, to android
@bradwilson@mastodon.social avatar

There are more positives than negatives in replacing my S22 Ultra with a Pixel 8 Pro, but the one nearly unforgivable sin is that Google doesn't let you set a charge cap. You think this is a phone designed to last 7 years? Not if people are keeping their battery at 100% all the time it isn't. #android #pixel #pixel8

bradwilson, to gaming
@bradwilson@mastodon.social avatar

Am I going to enjoy Doom64 if I didn't play the first 63? #gaming

bradwilson, to random
@bradwilson@mastodon.social avatar

I will consider it a social media victory when @xunit has more followers than I do. There's just no logical reason why more people are interested in me as a person than the thing I'm known for. 😂

(That was never going to happen on the dead bird site, but it has a chance of happening here. Also, this is an invitation to follow xUnit.net, not an invitation to un-follow me. 🤣)

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

If @xunit were a human, it would be able to drive today. 😂 Happy 16th birthday! #dotnet #csharp #fsharp #unittest #tdd

bradwilson, (edited ) to dotnet
@bradwilson@mastodon.social avatar

If I'm writing an analyzer to say "stop doing X in xUnit.net v2 because it's been removed in v3", should that be INFO or WARNING by default?

#dotnet #csharp #roslyn #RoslynAnalyzers

bradwilson, to random
@bradwilson@mastodon.social avatar

My life is made better by @shanselman's tireless support of the tech community here and on other social media platforms. I didn't meet him here (we've known each other for many years now) but this is still a long overdue thank you. https://mastodon.social/@GeePawHill/110936973287092343

bradwilson, to random
@bradwilson@mastodon.social avatar

In my dream the Wi-Fi went out so I woke up because I'm not putting up with a lack of Internet, even while sleeping. 😂

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Been trying out the new C# Dev Kit on VS Code, and my first case of "no no oh god no don't do that!" was when it silently auto-created a solution file when I open a folder that has a .csproj in it.

bradwilson, to random
@bradwilson@mastodon.social avatar

Converting analyzers tests to run against both @xunit v2 and v3, and only 33 failures (with 1345 passing). All are because of ambiguity between Func&lt;Task&gt; and Func&lt;ValueTask&gt; when using things like inline async lambdas (since v3 introduces support for ValueTask, which is not part of v2).

Not bad. 👍

This means xunit.analyzers will soon officially support v3!

bradwilson, to random
@bradwilson@mastodon.social avatar

I had a very tiring thought today: I've made a bunch of changes to the v2 branch of @xunit that I haven't necessarily forward ported to the v3 branch.

That's gonna be a lot of time in gitk.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • lostlight
  • All magazines