I’m a long time listener of .NET rocks and today during my drive to work while listening to TDD on .NET and Java with Paul Mooney, Carl mentioned a cool tip I want to share with you. In the past I have use XSD.exe to create classes from XML files for serialization purposes (and similar … Continue reading Visual Studio tip: paste json/xml file as class
Tag: C#
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++
FizzBuzz TDD kata– using Reactive Extensions
I was thinking about Reactive extensions (and using it) and then it hit me – why not try and use Reactive Extensions (Rx) in order to perform the FizzBuzz kata – it seems like a perfect fit.And so I set myself to try and use only Rx when performing this TDD kata.What is this FizzBuzz … Continue reading FizzBuzz TDD kata– using Reactive Extensions
Take care when using comma in C++
A friend had a weird bug while working in C++ last week. As sometimes it’s required he had to convert a string to an integer and instead of writing: auto result = (SomeEnum) (stoi(s, nullptr, 10));He wrote this:auto result = (SomeEnum) (stoi(s, nullptr), 10);Such a simple case of misplaced parenthesis caused the result to equal … Continue reading Take care when using comma in 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
What I hate about BDD
Disclaimer: this is not a TDD vs. BDD post – now that we’ve got that out of the way let’s discuss the thing I hate most about BDD…I’ve recently started using BDD (again). My tests are still “unit tests” – they do not call a database nor any other external dependency, and since even when … Continue reading What I hate about BDD
Visual Studio 2014 CTP – first impressions
I’ve installed the latest VS2014 CTP3 on my aging I3 home machine – because why use a VM when I can always re-install windows.And so far I’m impressed! this is a low end I3/4GB machine and it loaded fast and works without any noticeable performance issues – I might be mistaken but it seems the … Continue reading Visual Studio 2014 CTP – first impressions
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)
