Skip to content

Instantly share code, notes, and snippets.

using System.Web.Mvc;
namespace website.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
using System.Web;
using System.Web.Mvc;
using MvcIntegrationTestFramework.Hosting;
using NUnit.Framework;
using website.Properties;
namespace website.tests
{
[TestFixture]
public class HomeControllerIndexTests
@agileguy
agileguy / mvcIntegrationTests.cs
Created April 17, 2012 06:55
MVC Integration Tests
using System.Web;
using System.Web.Mvc;
using MvcIntegrationTestFramework.Hosting;
using NUnit.Framework;
using website.Properties;
namespace website.tests
{
[TestFixture]
public class HomeControllerIndexTests
@agileguy
agileguy / sudo.ps1
Created December 14, 2011 14:36
SUDO for Powershell
$file, [string]$arguments = $args;
if([System.IO.File]::Exists("$(get-location)\$file"))
{
$file = "$(Get-Location)\$file";
}
$psi = new-object System.Diagnostics.ProcessStartInfo $file;
$psi.Arguments = $arguments;
$psi.Verb = "runas";
[System.Diagnostics.Process]::Start($psi);
@agileguy
agileguy / socketExample.js
Created April 8, 2011 20:15
My first node.js socket server
require('datejs');
require('sys');
var net = require('net');
var sockets = new Array();
var server = net.createServer();
server.once('connection', function () {
setInterval(function(){
@agileguy
agileguy / enumerationSpike.cs
Created February 24, 2011 23:16
The Essence of David's Original Tests
namespace sandbox
{
using Specify;
using Specify.Assertions;
public enum TestEnum
{
Zero = 0,
One = 1
}
@agileguy
agileguy / mtSpec_Failing_Spec.cs
Created February 13, 2011 22:59
failing spec
using System;
namespace mtSpec
{
public class FailingSpec
{
Given _context =()=> { };
When _something_bad_happens =()=> { };
Then _kaboom =()=> { 1.ShouldBe(2); };
}
}
@agileguy
agileguy / mtSpec_Passing_Spec.cs
Created February 13, 2011 22:48
passing spec
using System;
namespace mtSpec
{
public class PassingSpec
{
Given _context =()=> { _a = 1; };
When _something_happens =()=> { _b = 1; };
Then _specifications_are_met =()=> { _a.ShouldBe(_b);};
static int _a;