FOr those of you who haven't read the previous post. This post is the 2nd of many where I explain how to use C# and a bag of tricks to create fluent interfaces – easily. In the previous post I’ve talked about what fluent interfaces is all about and gave a brief introduction to the … Continue reading Fluent Interfaces in C# – Extension Methods
Tag: .NET
Software news – May 2012
Again it’s that time! I have some cool new/updates software I want to tell you about. This time I got three products for the .NET developer that were just released. nDepend V4 A new nDepend version was just released with a few features but I just got to play around with two of them: The … Continue reading Software news – May 2012
Creating robust tests with Isolator V7
The problem with unit tests is that they keep on breaking…Obviously that’s not entirely correct, nevertheless I had the pleasure of hearing the sentence above numerous times. It’s true – unit tests do tend to fail and we prefer that they fail only when a regression occurs – when something that used to work stopped … Continue reading Creating robust tests with Isolator V7
AOP sessions on IDNDUG
I’ve just come back from my dual session on AOP on the local user group. The first part was introduction to AOP – what is it and why should you care.I’ve also reviewed several ways to implement AOP in your code from functional programming to full AOP frameworks.Introduction to aophttp://static.slidesharecdn.com/swf/ssplayer2.swf?doc=introductiontoaop-120321143232-phpapp02&stripped_title=introduction-to-aop&userName=dhelper View more presentations from Dror … Continue reading AOP sessions on IDNDUG
NUnit’s new Action Attributes is AOP to your unit tests
With the new NUnit release (v2.6) introduce a new feature called Action Attributes which means that now NUnit has rolled out it’s own mini-AOP capabilities. In the past SetUp and TearDown where used to perform actions before and/or after a test run, they worked well enough but were limited to running certain operation only on … Continue reading NUnit’s new Action Attributes is AOP to your unit tests
Refactor “if” statements – functional programming style
Have you ever seen code that look like this: public string GetStatusDescription(Model model){ if(model.HasProblemReports) { return "Errors"; } if(model.SystemState.WorkingMode == WorkingMode.NotManaged) { return "Manual"; } if(model.SystemState.IsInitializing) { return "Initialize"; } if(!model.SystemState.InService) { return "Not in service"; } if(model.SystemState.WorkingMode == WorkingMode.Paused) { return "Paused"; } if(model.Storage.Objects.Any(obj => obj.IsMoving)) { return "Movement in storage"; } return string.Empty;}I … Continue reading Refactor “if” statements – functional programming style
List executed code using PostSharp
This post was created to answer a question by Laimonas Simutis on the ALT.NET mailing list – how to list all executed code…There where many good ideas and your truly suggested using PostSharp – mainly because this is one of the examples I use in my AOP and PostSharp presentation. And so without further ado … Continue reading List executed code using PostSharp
Three .NET "tools" that I use every day and you want to know about
Time is a very limited and expensive resource. As a software developer I feel more often than not that I just don’t have enough of it…That’s why whenever I find a new library or tool that save me time I embrace it with both hands, especially if they preform tasks that I find boring and … Continue reading Three .NET "tools" that I use every day and you want to know about
Enabling parameterized tests in MSTest using PostSharp
I have blogged about the shortcoming of Microsoft’s unit testing framework in the past. It has very good Visual Studio (and TYFS) integration out of the box but it seems that in order to use it I have to suffer lack of functionality I’m used to taking for granted when using any other .NET unit … Continue reading Enabling parameterized tests in MSTest using PostSharp
Supercharge Isolate.Verify
At work we use Typemock Isolator for all of our Isolation/Mocking needs. Lately I’ve noticed that my co-workers do not like to use verify. One of the reasons they prefer not to use it is that sometime Verify error messages leave much to be desired. There are a few simple tricks that helps Isolator help … Continue reading Supercharge Isolate.Verify