Egil Hansen
banner
egilhansen.com
Egil Hansen
@egilhansen.com
Distinguished Developer at Delegate, Microsoft #MVP and creator of #bUnit. 🇩🇰 living in 🇮🇸. Creator of bunit.dev. #dotnet #blazor #bUnit #oss.
Pinned
If you find my work in the #dotnet open-source community useful and you (or your company) would like to support my efforts, doing so through GitHub Sponsors is an excellent choice. Learn more here: github.com/sponsors/egil
Sponsor @egil on GitHub Sponsors
Support Egil’s open-source work in the .NET community. His primary contribution is the Blazor testing library bUnit, that enables testing of Blazor components like regular POCO.
github.com
Thanks Stacy.
The last couple of days I've been playing with @egilhansen.com's amazing #bUnit.

So eay to work with, and I love that you can test both the markup, *and* the razor components that are present (or not) on your rendered component. Fantastic!

bunit.dev
bUnit - a testing library for Blazor components | bUnit
bUnit is a unit testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can intera...
bunit.dev
November 22, 2025 at 2:13 PM
Want more of this? Back in October, I did a presentation on this exact topic at @hellostavanger and it covers a bunch of extra details and examples we didn’t get to in the podcast: youtu.be/yT1ckNTCW60?...
November 22, 2025 at 2:12 PM
Yeah I’ve lost countless hours to build pipelines.
Custom images/runners is the way to go. Basically docker image that runs your pipeline scripts. Then you have much more control over things.
October 18, 2025 at 10:02 AM
Reposted by Egil Hansen
You write tests. But are they helping you and your team?
In this .NET Rocks! episode, @egilhansen.com explores how to make tests more durable, insightful, and future-proof. Plus: should AI be writing your tests? 🤖 #dotnet
🎧 Listen here: msft.it/63323sFo2T
October 16, 2025 at 11:37 PM
They will be very useful in source generator scenarios.
October 16, 2025 at 7:31 AM
Suffering for your friends I see 🙂
October 16, 2025 at 7:28 AM
Oh ffs. Spelling is hard. Pleasure. It’s a pleasure 😆
October 9, 2025 at 7:25 PM
Always a please chatting with Carl and Richard on their podcast!
October 9, 2025 at 3:07 PM
It would 🙂
June 7, 2025 at 9:42 AM
Try LinkedIn, it’s all self-congratulatory posts 🙂
June 2, 2025 at 5:50 AM
I’ve also had good success using this package: www.nuget.org/packages/Mez...
May 14, 2025 at 7:45 PM
I am more thinking about what to snapshot test and what not to snapshot test.

E.g., a rule I try to follow is to not include irrelevant (to the test) data in the snapshot, as it makes it harder to validate the snapshot when it changes.
May 2, 2025 at 10:11 AM
@simoncropp.bsky.social do you have a list of does and donts in snapshot testing somewhere? Examples of good patterns and anti patterns with Verify?
May 2, 2025 at 7:01 AM
If the facts are as the article lays them out, I hope one of my friends from #microsoft will make this right. Adherence to OSS licenses is important!

philiplaine.com/posts/gettin...
Getting Forked by Microsoft
Three years ago, I was part of a team responsible for developing and maintaining Kubernetes clusters for end user customers. A main source for downtime in customer environments occurred when image reg...
philiplaine.com
April 21, 2025 at 1:42 PM
Yep, saw this live. Huge respect for people that dare to be vulnerable; it’s such a powerful thing.
an incredibly moving talk from @rendle.dev
www.youtube.com/watch?v=fL2p...
April 6, 2025 at 9:05 AM
Need a cure for that primitive obsession in #dotnet? Take a look at www.nuget.org/packages/Egi...

First real attempt at a source generator library. Happy with the result. A key feature is that it’s very easy to overwrite the default generated code, just as it is with C# record classes and structs.
Egil.StronglyTypedPrimitives 1.9.7
A source generator for creating strongly-typed primitive types that makes it easy to avoid the primitive obsession anti pattern. Add a [StronglyTyped] attribute to a partial record struct ...
www.nuget.org
April 4, 2025 at 11:48 PM
Going live with @steven-giesel.com for the first #bUnit dev session of this month. We may even get a visit from @scottsauber.com :)

Join at twitch.tv/egilhansen and www.youtube.com/watch?v=jZrZ...
April 4, 2025 at 1:32 PM
Congrats Scott. You are living the dream!
March 28, 2025 at 7:38 AM
This could be said about the internet in general.
its amazing how chatgpt knows everything about subjects I know nothing about, but is wrong like 40% of the time in things im an expert on. not going to think about this any further
March 10, 2025 at 12:31 PM
Hey folks, @steven-giesel.com and I just went live with another #bunit dev session. Come hang and lets build v2 together.

www.youtube.com/watch?v=fvBn...

and

twitch.tv/egilhansen
bUnit dev session #28
YouTube video by Egil Hansen
www.youtube.com
March 7, 2025 at 1:42 PM
Actually, I think I usually do a `git clean -fdx` for a "reset the world" operation.
March 6, 2025 at 10:15 PM
There is a git command that does it, just can’t remember it when I need it, so have to search the web. If your tool had a -all option that would be great 😊
March 6, 2025 at 7:56 PM
Could it also have an option that does the same a clean git clone?

Sometimes deleting e.g., the .vs folder helps with weirdness in vs.
March 6, 2025 at 6:49 PM
By using Aspire and related client libraries you get basic telemetry out of the box (without solution specific context), so I’ll do that and then add some/few end-2-end tests for basic protection against regressions.
March 3, 2025 at 7:40 AM
Solve different problems, so it’s like comparing apples and oranges.
March 2, 2025 at 8:34 PM