Posts tagged with "ReSharper"

Refactoring huge C# code base in minutes

Feb 20, 2023

With my team, we like to keep our C# code base updated. So, recently we went to .NET 7 and C# 11. At the same time, we were still adopting some of the new capabilities of .NET 6 and C# 10. Our code base is large, so it takes some time. One of the new features that we planned to use was the ArgumentNullException.ThrowIfNull method, which throws an exception if an argument is null. In this post, I will show you how I effortlessly did that refactoring by letting the machine work and not the human 😁 (me). In the past, I used the same approach to migrate lots of code that used Assert.True() to Assert.That(, Is.True) and for some other even more complex cases. We will use ReSharper and Rider for that.

Continue reading

Test Driven Development Kata - String Calculator

The subject of this article is the String Calculator proposed by Roy Osherove. The Kata is done in C# uses Visual Studio 2012, JetBrains Resharper 7 and NCrunch.

But what is a TDD Kata? It is an implementation exercise starting with unit tests and leveraging refactoring that you practice daily for around 15 to 30 minutes.

Continue reading

Fixing ReSharper inspection Results used from XAML

Finishing this week sprint I decided to inspect some code using ReSharper 6.1 EAP and I started to give ReSharper a chance to help me find some of broken code.

When I started I had some of the following inspection results. It is clearly showing that some properties wasn’t identified as used in a WPF binding.

Continue reading

Using Resharper Search with Pattern to protect you from your code

Nov 19, 2010

Today I faced a nasty bug, a null pointer exception in a property databound to our WPF application. This had some nasty side effects, and for sure this part of the code didn’t had any unit test, too bad! For sure now it has.

The line of code was really simple

Continue reading

Page 1 of 5