- I am the class being tested. Thou shalt not test any other class but me.
- You shall not make for yourself a mock of an API that you don't own.
- You shall not call a system or integration test a unit test.
- Your unit test suite shall not take all week to run.
- [father and mother]
- Thou shall not kill the runtime environment.
- [adultery]
- [steal]
- You shall not bear false witness against your neighboring tests.
- You shall not covet your system's files, you shall not covet your system's threads, or his sockets, or his graphics environment, or his environment variables, or anything that is part of your system.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void setInitialUsedSpace() | |
{ | |
_sizeCalculator.Calculate().ToList() | |
.ForEach(calculation => DecreaseUsedSpaceForVolume(calculation.Key).With(calculation.Value)); | |
_volumes.ForEach(x => logInitialSize(x)); | |
} | |
private void handle(UploadFinishedMessage message) | |
{ | |
var task = message.Task; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using RabbitMQ.Client; | |
using RabbitMQ.Client.MessagePatterns; | |
using RabbitMQ.Client.Framing.v0_9; | |
using System.Threading; | |
using System.Text; | |
namespace SladrehankEnqueuer.Core | |
{ | |
public class Enqueuer | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Func<string, bool> _itemHandler; | |
private IConnection _connection; | |
private IModel _channel; | |
private QueueingBasicConsumer _consumer; | |
private bool _stop = false; | |
public Dequeuer(Func<string, bool> itemHandler) | |
{ | |
_itemHandler = itemHandler; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
namespace MinimalMessaging | |
{ | |
public class MessageDispatcher : IMessageDispatcher | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class VimWindowNavigateLeftCommand(sublime_plugin.WindowCommand): | |
def run(self): | |
next = 0 | |
active = self.window.active_group() | |
if active > 0: | |
next = active - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using ContinuousTests.ExtensionModel; | |
using ContinuousTests.ExtensionModel.Arguments; | |
namespace test | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Version: 0.21.1 | |
Main project does not update assembly info | |
D, [2014-01-20T14:40:52.948831 #27329] DEBUG -- : Executing xBuild: "xbuild" "src/Nancy.sln" /p:configuration="MonoRelease" /p:TargetFrameworkProfile="" /p:TargetFrameworkVersion="v4.0" | |
XBuild Engine Version 2.10.8.1 | |
Mono, Version 2.10.8.1 | |
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011. | |
Build started 1/20/2014 2:40:53 PM. | |
__________________________________________________ | |
Project "/home/ack/src/Nancy-0.21.1/src/Nancy.sln" (default target(s)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import subprocess | |
def runProcess(exe,workingDir=""): | |
if workingDir == "": | |
workingDir = os.getcwd() | |
subprocess.Popen(exe, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=workingDir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "/home/you/src/thisthing/lib/JSONNet/Newtonsoft.Json.dll" | |
open System | |
open Newtonsoft.Json | |
// Identifier type | |
type Id = System.Guid | |
module EventStore = | |
type VersionedEvent = int * string |
OlderNewer