Showing posts with label Unit Testing. Show all posts

BDD Mini Match-up

 
event

I cannot say I am a big BDD-er. I have used it for commercial projects, mostly to define complex scenarios for complex pieces of code (a custom discount engine comes to mind) but it comes with a price tag that I am not willing to pay for the majority of tests I write (unit tests).

I am not going to describe what BDD is, philosophy, syntaxes, flavors… I am just going to mention my experience with a couple of tools one can use if developing for the .NET Framework.

share
comment
  class , , ,

Contract Verification in NUnit. Comparisons

 
event

Before anyone gets confused I am using a very broad definition of contract that it is not related at all with Code Contracts or Design by Contract.
What I mean by contract is the correct implementation of an interface that has become idiomatic. And before you ask, an interface is not a contract. I consider it part of the definition of a contract, but it lacks on the definition of the obligations of client and supplier and most importantly, the verification of such contract. And also before you ask, no, Code Contracts do not provide all the means to express complex obligations and outcomes when conditions are met.

Documentation Does Get Outdated

 
event

I am not going to start another flame war about whether documentation is evil or not.

My personal stand is that is evil but mostly needed.

share
comment
  class , ,

Configure Reality

 
event

Configuration in enterprise application is a fact of life.
My take on it is as follows: delay it as late as possible and hard-code in anger until someone asks for a change. Then, accepting the fact that is likely to happen again, the value is pushed into configuration.

The Magnificent Sixteen

 
event

GUIDs are precious little things. Useful, annoying at times, but lovable nonetheless. Cherish them as if they were unique (all pun intended) and they will pay your love back.

share
comment
  class , ,

Testing.Commons. It’s a matter of time

 
event

Face it: time is everywhere and cannot run away from it. That is why I chose time to be the subject of the first release of Testing.Commons, a mere 0.1.

Classes that deal with time in the BCL (DateTime, DateTimeOffset, TimeSpan) might have their issues. They might not be accurate. They might not be correct at all. There might be some better alternatives. But they are not going anywhere, anytime soon.

share
comment
  class , ,

A Little more OSS

 
event

As the reader might have notice, I am a big advocate of testing. During the years that I have been practicing some flavor of testing I have been developing, borrowing and using small little classes (or bigger ones) and techniques to make my life easier and my code suck a little less.

Anonymous Delegates, Parameters and Unit Testing

 
event

Anonymous delegates, lambdas and their akin are here to stay and make our life easier.

Despite being in the framework since day one (well, not in their anonymous incarnation and definitely not in their lambda form) delegates have had some sort of “Cambrian explosion” in their usage since the advent of LINQ. More and more developers have been exposed to their benefits and more a more APIs make use of them.

share
comment
  class , ,

Configuration Weirdness

 
event

The other day I had an issue with a custom configuration section I would like to talk you about.
My take on configuration is stick as much as possible with .settings configuration until collections, nested elements or some other advance technique is needed. It does not happen often that I need a custom section, though. 
My requirements were very simple: a custom configuration element with a mandatory string attribute that must be non-empty.

share
comment
  class ,

Unit Testing Asp .NET Profiles. Part 3, Test-Friendly Provider

 
event

We left the story in the “how” retrieve the data from the profile system in our tests. Introducing the ProfileTestProvider.

share
comment
  class ,

Unit Testing Asp .NET Profiles. Part 2, Consumer Service and Configuration

 
event

In the previous post we learnt how we could wrap the profile system and test that we could map basic information into more complex objects. In this post we are going to use that profile wrapper as another datasource used to construct more complex and (hopefully) interesting objects.

share
comment
  class ,

The ASP.NET Profile system and Unit Testing. Part 1

 
event

My team and I have been happily using ASP.Net Membership alongside Forms Authentication to provide authenticated access to private areas of our with zero problems. We have been using the default Sql Server storage, which was a walk in the park after fighting against custom Active Directory access and its security issues.

share
comment
  class ,