Pester: pretty summaries

Short examples of a mix of passing and failing Pester tests being rendered in a browser, using ReportUnit, available on NuGet, and ingesting NUnit output format. Check out the browser screenshots below first for the end result.

Code

# Runs all test suites, passes the output to the NUnit format, renders it, displays in a browser

# see my article here for installing nuget via Choco:

# https://dennisaa.wordpress.com/2017/04/26/powershell-updating-jpg-metadata/

# https://www.nuget.org/packages/ReportUnit/

nuget.exe install ReportUnit

#Then, for example...

# Execute all the tests

$outputName = Get-Random

$outputFile = "$PSScriptRoot/$outputName.xml"

$htmlFile = "$PSScriptRoot/$outputName.html"

Invoke-Pester -PassThru -Strict -OutputFile $outputFile -OutputFormat NUnitXml

.\ReportUnit.1.2.1\tools\ReportUnit.exe $outputFile

Start-Process chrome $htmlFile
Advertisements

VSFF*: XUnit and related

VSFF* – Visual Studio Full Fat. Just to make an obvious distinction with VSCode.

Roslyn: First Steps

Roslyn, AKA the .Net Compiler Platform, is used in Visual Studio 2015 for the C# and Visual Basic compilers. MS Blog. My motivation is that I want a simple, small C# compiler footprint that I can use with Visual Studio Code.

Now Visual Studio is anything but lightweight (they REALLY got this naming wrong between VS and VS Code)… but if you go to Roslyn on GitHub, download Nuget.exe as Raw, go to Powershell I guess as Administrator, and run this:

.\nuget.exe install Microsoft.Net.Compilers

then you get the csc.exe and its dependencies.

Screenshots to cover all that:

Nuget01

Nuget02

Nuget03

Nuget04

Nuget06

Nuget05

Nuget07

NugetRoslyn08

NugetRoslyn09

NugetRoslyn10

OmniSharp01

OmniSharp02 OmniSharp03

OmniSharp04

OmniSharp05

OmniSharp06 OmniSharp07

Compilation using csc.exe

We then come to actually compiling something trivial. msdn guidance here.

This is a linked page from there to the simplest possible console app. Just SO disappointing in a page about VS2015, they’re using a Windows Batch script to wrap it and not PowerShell. Anyhoo… if you have this content:

(tidy up another time)

Link to the Roslyn wiki on GitHub: https://github.com/dotnet/roslyn/wiki/FAQ