Unit-Testing of Private Async Methods with Visual Studio

Description Given there is the need to unit-test a private async method. The class to be tested might look like this: public ClassWithPrivateAsyncMethod { // Some stuff private async Task PrivateMethodAsync ( string input ) { // Call some async framework method var result = await SomeFrameworkMethodAsync(input); // do something …

Using Windows Store App Resource Libraries in C# / XAML

Introduction Given there is a Windows Store app. Some of the resources that this app needs are part of a library. This library contains a XAML file (ApplicationStyles.xaml) for application specific styles and the StandardStyles.xaml that is generated when a new Windows Store App (XAML) project is created. ApplicationStyles.xaml uses …

Change Color of ToggleSwitch

Given you implement an app using the dark theme. This app contains some configuration values, which can be changed using a settings flyout. According to the design guidelines, the background of the settings flyout should be white. Unfortunately, the default color theme for all controls is dark. So they are …

SCC Removal Tool for TFS / Visual Studio

Preface Publishing sample code to the blog requires some manual tasks to remove all the source control configurations and files as well as the user specific files of Visual Studio. After publishing a few code samples, having to do the same changes manually again and again, I thought it was …

Handling of Out-Parameters with .NET Reflection

Since Microsoft decided to remove the creation of private accessors for unit tests in Visual Studio 2012, one have to get familiar with the usage of Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject. This class offers an easy way to call methods, independent from their visibility, via reflection. The method is PrivateObject.Invoke. This method saves you …

Checklist: Submitting an App with Ads to the Windows Store

Preface When you use the Microsoft Advertising Services, adding AdControls to your app is the easy part of the job (see my posts with a sample showing all the available ad types and how to configure AdControls to make it easy to switch between test mode and production ad). The …