Catch – multi-paradigm automated test framework for C++

When unit testing in C++ I tend to use Google Test/Mock, it’s simple to use, multi-platform solution. In the last few days I have been having second thoughts about it due to a new framework called Catch.What is (the) Catch?“Catch” stand for C++ Automated Test Cases in Headers. It’s an open source project (GitHubbed). What … Continue reading Catch – multi-paradigm automated test framework for C++

Unit testing concurrent code using custom TaskScheduler

Today I had a need to test an action that runs inside a Task: [code lang="csharp"] public class ClassToTest { private readonly IMessageBus _messageBus; private CancellationTokenSource _cancellationTokenSource; public event EventHandler OnNewMessage;</pre> public ClassToTest(IMessageBus messageBus) { _messageBus = messageBus; } public void Start() { _cancellationTokenSource = new CancellationTokenSource(); Task.Run(() => { var message = _messageBus.GetNextMessage(); // … Continue reading Unit testing concurrent code using custom TaskScheduler

4 programming books available online – for free

Software development books don’t come cheap and it’s fine. The author has spent countless hours and sleepless nights transferring his/her knowledge and should be compensated for it.But some authors have decided to provide an online version of their book and in some cases even a free e-book you can download.I found the book in the … Continue reading 4 programming books available online – for free

Strongly typed localized strings in universal apps

Back in the old days when the need for localized string arose, I would add a new string and use AppResources to access the correct string in code.In Windows Phone application (known today as Windows Phone Silverlight 8.0/8.1) I would do something like this:public void SomeMethod(){ var localizedString1 = AppResources.MyFirstSring; var localizedString2 = AppResources.AnotherString;}In the … Continue reading Strongly typed localized strings in universal apps

Syntax error when using explicitly defaulted/deleted functions in windows phone 8 project (C++11)

A few days ago a colleague of mine asked me to help with strange errors his C++ project kept throwing at him.Since it was a C++ project we had more than 200 compilation errors but as the  C++ veterans that we are we’ve ignored most of them and scrolled up until we’ve found the patient … Continue reading Syntax error when using explicitly defaulted/deleted functions in windows phone 8 project (C++11)