Archive for June 2017

UnitTest MsSql database using Slacker, SlackerRunner

Our open source MsSql UnitTest framework Slacker and SlackerRunner was featured on Microsoft Channel 9. Now it’s easier than ever to UnitTest your database and add it into your CI,CD build pipeline.

Watch Eric Kang from Microsoft explain in detail what you need and how it works.

Nlog configuration

I needed to add Nlog tracing that must be configurable from the config file. Finding a simple sample took a me a while. Therefor I’m putting the needed pieces here.

App.config

<?xml version=“1.0” encoding=“utf-8” ?>
<configuration>
  <configSections>
    <section name=“nlog” type=“NLog.Config.ConfigSectionHandler, NLog”/>
  </configSections>
  <nlog xmlns=“http://www.nlog-project.org/schemas/NLog.xsd”
    xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
    autoReload=“true”
    throwExceptions=“false”>

    <variable name=“appName” value=“sample” />
    <targets async=“true”>
      <target xsi:type=“File”
                name=“default”
                fileName=“sample.log”
                keepFileOpen=“false”
                DeleteOldFileOnStartup=“true”
            />

    </targets>
    <rules>
      <logger name=“*” writeTo=“default” minlevel=“Info” />
    </rules>
  </nlog>
</configuration>

And then in code, you can just do the following.

using NLog;
        Logger logger = LogManager.GetLogger(“mylogger”);
        logger.Log(LogLevel.Debug, “Hellow world”);