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.
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.
Other than showcasing how monetary quantities can be formatted and showing off the data available for different currencies, one of the objectives of NMoneys.Web is showing code samples on how to accomplish common tasks.
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
It’s rare these days to have a mostly free evening to look after some OSS.
NMoneys.Web is website, built with ASP.NET MVC. I might as well share with you a couple of things I learnt.
NMoneys.Web is a web application. End of post. Next.
A maintenance version of NMoneys has just been released. And there are surprises… unfold them.
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.
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.