Monthly Archives: October 2014

TDD setup in VS14

I’ve been trying out VS14 CTP4, doing some code katas and I was thinking if there is a better way I could set up my Visual Studio environment. The NuGet console works well for running tests on the command line or committing code but of course there is an XUnit runner plugin that works well to run the tests from within the IDE. After checking what the gurus say it seems having the test and the production code side by side is the way to go, which is easy when you have one class and one test. Ideally there would be a way to keep the window structure organised in some semi-automated way, but my limited googling has not given me any good answers, although unpinning most windows and keeping the test runner at the bottom and test- and production code in the rest of the screen is quite usable.

I haven’t installed ReSharper on this Visual Studio CTP which gives me a rare opportunity to try the native features before ReSharper saves the day and although the shortcuts are wrong (but you could easily remap Ctrl+. to Alt+Enter and feel less lost immediately) it does have the most basic features you need such as extract method and rename.

Overall it is possible to have a neat workflow as before but you would be hard pressed to let go of ReSharper as the quick create-shortcuts and the easy-to-use refactorings are hard to live without once you have used them in anger.

Posh Git

I have tried to get my head around PowerShell for a while, and I’ve read blogs by Scott Hanselman about PsReadline and PoshGit and decided to finally get on with it and use it properly.

This post is just a repository of my current setup.

Install PsGet if you don’t have it:

(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex

Install PsReadline:

Install-Module PsReadline

Install Git for Windows

http://git-scm.com/download/win

Install posh-git

Install-Module posh-git

Update the profile.ps1 file

Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)

# Load posh-git module from current directory
Import-Module PSReadLine
Import-Module posh-git

# If module is installed in a default location ($env:PSModulePath),
# use this instead (see about_Modules for more information):
# Import-Module posh-git


# Set up a simple prompt, adding the git prompt parts inside git repos
function global:prompt {
 $realLASTEXITCODE = $LASTEXITCODE

 # Reset color, which can be messed up by Enable-GitColors
 $Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor

 Write-Host($pwd.ProviderPath) -nonewline

 Write-VcsStatus

 $global:LASTEXITCODE = $realLASTEXITCODE
 return "> "
}

Enable-GitColors

Pop-Location

Start-SshAgent -Quiet

set-alias -name np -value "C:\Program Files\Sublime Text 2\sublime_text.exe"

function vsh() {
 Write-Output "Opening first solution..."
 $sln = (dir -in *.sln -r | Select -first 1)
 Write-Output "Found $($sln.FullName)"
 Invoke-Item $sln.FullName
}
 
function title($str) {
 (get-host).ui.rawui.windowtitle = $str
}
 
function ga() {
 Write-Output "Staging all changes..."
 git add -A
 git status
}

function gs() {
 git status
}

function gsd() {
 Write-Output "Pushing changes to subversion..."
 git svn dcommit
}

function gsf() {
 Write-Output "Checking subversion for recent changes..."
 git svn fetch
}
 
function gco() {
 param([switch]$amend, [switch]$a)
 
 $argstr = $args -join ' '
 $message = '"', $argstr, '"' -join ''
 
 if ($amend -or $a) {
 Write-Output "Amending previous commit with message: $message"
 git commit -m $message --amend
 } else {
 Write-Output "Committing with message: $args"
 git commit -m $message
 }
}
 
function gca() {
 $argstr = $args -join ' '
 $message = '"', $argstr, '"' -join ''
 
 Write-Output "Amending previous commit with message: $message"
 git commit -m $message --amend
}

Links

Windows 10 tech preview

So, later than everybody else I installed Win10 tech preview.

I am not agreeing with the versioning strategy and feel like Windows 8.2 had been a more fitting identifier given the limited changes, but the ill-deserved but yet pervasive stigma of the new-fangled Windows 8 had to go away, so I see why going with a major version increase might have made sense.

Multiple desktops is easier to use than Sysinternals Desktops, with the isolation being less complete, so you can Windows Tab between all apps irrespective of desktops and easily move windows between them.

The semi transparent console window thingy is pretty neat but I’m surptised by the limited font choices. Copy / Paste and proper selection just worksTM and I suspect that just like after Ctrl-S arrived in Notepad on Windows 2000 it will probably be inconceivable that it ever worked differently. I installed the operating system on VMWare player and threw in VS14 which diesn’t compile the ASP.NET vNext, but I have spent literally 0 seconds figuring out why and I suspect I haven’t configured something right. The MS Twitter app doesn’t work on my VM, neither does OneGet specifically because Chocolatey is not a provider and no methods of adding providers worked.

I resorted to install Git like a barbarian, downloading the installer from git-scm.com/downloads, but posh-git and psreadline worked as expected. Finally I had a very neat git environment set up in a few moments. I like.

The start menu feels a bit weird, but does make more sense with a desktop OS and I will probably find it more useful as time goes by.

So anyway, if you have an extra computer laying around, get Win10 and try it out. I’ve reported my gripes to the feedback tool, I suggest you do the same. Don’t believe they hype, it’s just a really nice Windows 8.1 Update 2/ Windows 8.2, not  a revolution by any means, just good small improvements overall.

MOVSXD

I have relocated to the Southeastern outskirts of London with my family since I last posted. After 5 years with Jayway it was strange to leave, but a new adventure in a new country awaited. I started working at Cloudhouse Technologies that are developing application virtualisation- and data access virtualisation products. A whole heap of very clever developers work here and we are looking for more such people. We provide ways for companies to leverage new technologies to run applications developed for earlier platforms and network topologies and the work ranges from analysing network logs, designing distributed systems, playing with various low-level API:s and sometimes smithing some websites. I couldn’t believe the job spec when I saw it, it’s like a kinder surprise with all fun things rolled into one. Anyway, so that’s what I have been doing and what has kept me busy.