My latest course: Advanced C++ Mocking Using Google Mock was published during the weekend. After finishing my very first Pluralsight course I knew I want to author another one. I've been working with C++, Java and .NET developers for the last five years, teaching about clean code, design patterns and unit testing. I've seen good developers struggle with TDD, … Continue reading New Pluralsight course: Advanced C++ Mocking Using Google Mock
Tag: Mock objects
Faking DateTime using Microsoft Fakes seems to be broken
It seems as if causing DateTime.Now to return another value has become the demo to show when demoing an unconstrained Mocking framework. It’s easy to show and needed in many unit tests – unless you want your tests to be affected by time – trust me and you don’t. That’s why I was amazed to … Continue reading Faking DateTime using Microsoft Fakes seems to be broken
How to fake a singleton in C++
When unit testing legacy code I find several (anti) patterns which prevent getting code under test. The most recurring pattern I see is the Singleton pattern – a useful pattern when not abused and overused.In the object oriented world Singleton’s are slightly better than their evil cousin – the static method. Unfortunately I’ve seen them … Continue reading How to fake a singleton in C++
Using NUnit and FakeItEasy to create fake objects automatically for your tests
From time to time I get to teach and mentor Java developers on the fine art of unit testing. There are many similarities when unit testing in Java and .NET but more interesting are the differences between the two. Faking objects in Java using MockitoOne of the well-used Java Isolation (Mocking) frameworks is called Mockito … Continue reading Using NUnit and FakeItEasy to create fake objects automatically for your tests
New Speaking engagement – DevWeek 2015
Now that I’m back from NDC London I have a chance to plan my upcoming speaking engagements – and it’s going to be a few busy months.I’ve already blogged about my plans for the next few months but since then I found out that I’ll be coming back to London (always a pleasure) in March … Continue reading New Speaking engagement – DevWeek 2015
What to do when FakeItEasy throws System.BadImageException
Today I had a weird problem at work. I’ve been working with a new team and they’ve been writing unit tests using FakeItEasy when they got a strange error message:System.BadImageFormatException: … The signature is incorrect.Now I’ve been using FakeItEasy for some time and I never once saw this strange behavior. Googling for the problem only … Continue reading What to do when FakeItEasy throws System.BadImageException
Test Drive your windows phone application
Today I presented the topic of unit testing (surprise, surprise) and Test Driven Development for windows pone applications. I’d like to thank those who managed to arrive to the meeting despite the weather – it was a pleasure. My talk was at the second part of the meeting - right after Eyal who showed how … Continue reading Test Drive your windows phone application
On object creation and unit tests
There is always a balance between readability and maintainability when writing unit tests.I hate hearing a fellow developer say – “the task took me X time more because I had to fix 100+ tests because I refactored my production code”. This means I’m always on the look for ways to decrease the tests maintenance overhead.While … Continue reading On object creation and unit tests
Going to London X 2
It’s been a while since the last time I’ve been at the UK and finally I got a chance to come for a visit.Next month I’m coming to London tom speak at the Agile Tour (1st Nov.).My session will be about how to be agile even if your company isn’t.But that’s not all – I … Continue reading Going to London X 2
Simple Mocking in C++
I’ve been working in C++ for a few months now – after three years we’ve been apart.I always amazes me how simple things I took for granted do not exist (at least not out of the box) in C++, one of which are reflection.Two weeks ago I needed to make sure that a method was … Continue reading Simple Mocking in C++