BDD Mini Match-up

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.

Read More →

NMoneys.Serialization.*

I have already touched the subject of NMoneys serialization in the context of a third party serialization library. Even a custom converter was released as a Nuget package. But real world experience taught me it is not enough. A new model I have always been hesitant on the policy to adopt when depending on third party libraries in my packages: shall I fix it to a known version? Fix the upper limit to the next semantic version and hope for the best? Update the minimum version every now and then? Quite a few questions and few definitive answers. In this particular case (serialization using a Json.NET converter), I chose to break with the past and deliver the custom converters and everything else as source code and remove the dependency to the serialization framework from my package.Is this the way to go? It definitely has its advantages, but time will tell. New horizons A side effect of the decision is allowing the user of the package to tweak the serialization process or remove the artifacts that won’t be used.It also gives me the opportunity to supply the same code for Json.NET and RavenDB (that uses an internalized version of the former) just by switching namespaces during the build process.

Read More →

Searching Currencies

The main reason that NMoneys.Web was envisioned (apart from the learning experience) was to provide information about how the library displays monetary quantities in order for non-technical users to be able to spot mistakes or improvements. Such requirement is fulfilled in the Currencies section

Read More →

Testing.Commons.ServiceStack

A new sibling has joined of the Testing.Commons family. Testing ServiceStack services I have reviewed, worked (and presented) extensively on ServiceStack lately. With work done comes testing your work. And I found ServiceStack to require little plumbing to do integration tests. But there is some. And there, Testing.Commons.ServiceStack can help with your integration tests. Low barrier testing Create a class library project Install ServiceStack nuget package (the latest free version): Install-Package ServiceStack -Version 3.9.71 Install Testing.Commons.ServieStack nuget package: Install-Package Testing.Commons.ServiceStack Create a test that inherits from either SingleHostPerFixture or SingleHostPerTest Happy testing! More? Go to the documentation page for guidance or, better yet, project’s automated tests.

Read More →

A custom money format

Last week, while I was happily vacationing in Spain, I received an email from an NMoneys user with a deceptively simple question: “When formatting a Money instance, how does one remove the decimals if the amount is integral?” It is not straightforward Even though Money supports custom formatting via .ToString(format) and .Format() overrides, none of them allows conditional treatment depending on the nature of the amount.

Read More →