Skip to content

Instantly share code, notes, and snippets.

@joshilewis
joshilewis / MyClass.cs
Created February 1, 2012 09:06
Simple Unit of Work implementation
using System;
namespace ClassLibrary
{
public interface IDependency
{
void SomeMethod();
}
public class MyClass
@joshilewis
joshilewis / MyClass.cs
Created February 5, 2012 12:50
Testing simple unit of work
public class MyClass
{
private readonly IDependency dependency;
private readonly Func<IUnitOfWork> StartNewUnitOfWork;
public MyClass(Func<IUnitOfWork> unitOfWorkProvider),
IDependency dependency,
{
this.dependency= dependency;
this.StartNewUnitOfWork = unitOfWorkProvider;
@joshilewis
joshilewis / MyClass.cs
Created February 5, 2012 14:00
Simple Unit of Work implementation
using System;
namespace ClassLibrary
{
public interface IDependency
{
void SomeMethod(string s);
}
public class MyClass
@joshilewis
joshilewis / NHibernateUserAuthRepository.cs
Created March 8, 2012 12:50
NHibernate-based implementation of ServiceStack's IUserAuthRepository
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Globalization;
using ServiceStack.ServiceInterface.Auth;
using ServiceStack.Common;
using NHibernate;
@joshilewis
joshilewis / Item JSON
Created February 13, 2014 21:12
Sample of JSON for Item
{
item: {
id: "2950a2d262a34ffcae82a2d0015af091",
title: "title1",
creator: "creator1",
edition: "edition1"
}
}
@joshilewis
joshilewis / GoLTests.cs
Created December 8, 2015 07:44
How I do TDD
[Test]
public void Test_Barge()
{
var initialGrid = new char[,]
{
{'.', '.', '.', '.', '.', '.'},
{'.', '.', '*', '.', '.', '.'},
{'.', '*', '.', '*', '.', '.'},
{'.', '.', '*', '.', '*', '.'},
{'.', '.', '.', '*', '.', '.'},
using System;
using NUnit.Framework;
namespace Tests
{
[TestFixture]
public class Test
{
public class Temp
{