Code

Producing a Zip or Tarball when building a .NET Core console app

There’s a .NET Core console app I’m working on that will need to be published a few different ways. The simplest way to share a downloadable app is in a self-contained tarball (.tar.gz extension) or zip file. Eventually package managers like Chocolatey and rpm/deb files will be needed, but a downloadable, versioned archive file is good enough to get started.

First I did a quick search to see who has solved this problem already. :). One solution I found was qmfrederik/dotnet-packaging on GitHub that looked promising.  It seems like early days, currently version 0.1.45, but it’s published on NuGet under the MIT license so that’s good enough to use as a build tool.

All told – it was quick and easy to integrate – though in my case I needed to push the tool a little to get the results I was looking for. In this post I’ll walk you through that.

Continue reading

Code

Using test stubs instead of mocks

Well, I’ll just come right out and say it. I’m not really a fan of mock libraries for unit test code. I think they’re the wrong kind of lazy.

As a programmer being lazy is good. Keep it in the back of your mind as you’re working. Not line-by-line thinking about how many keys you have to hit – more task-by-task thinking about what approach will become less of burden for you or your team in the long run.
Continue reading