NUnit has a custom attribute called ExpectedException that you can use to assert if your code is throwing an expected exception, the common case looks like the code below: [Test] [ExpectedException(typeof(InvalidOperationException)) public void Add_RoleWithoutName_Exception() { var target = new RoleGroup(); target.Add(new Role()); } This works pretty well, but how we can test many case exceptions […]

You have programmed an amazing functional tests to validate your infrastructure service that connect on Google Docs. These functional tests run perfect well on your development machine and now you want to run them on Travis CI, but how to do this without reveal your Google’s username and password¬†worldwide? Travis CI Encription Keys goes to […]

Because we can get unexpected results! (after read this tip, will be expected results ;)) What is the diference between these two Linq queries? Query 1 var filterDate = DateTime.UtcNow; ctx.Set.Where(m => m.DateTime > filterDate);   Query 2 ctx.Set.Where(m => m.DateTime > DateTime.UtcNow);   The first one will generate a SQL with WHERE clause like […]

The Eric Evans’ book “Domain-Driven Design – Tackling Complexity in the Heart of Software” is like a Bible for who intend to use DDD, so, I guess that some quotes of the book can help us to validate our DDD approach. The list below is just a “check-point list”, because, to understand what each one […]