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 Ploeh.Albedo; //among others | |
public static class Sql | |
{ | |
public static ISqlParameterValue Null() | |
{ | |
return SqlNullValue.Instance; | |
} | |
public static ISqlParameterValue VarChar(string value, int size) |
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
[Fact] | |
public void returns_a_description_for_a_finished_build_that_failed() | |
{ | |
var now = DateTimeOffset.UtcNow; | |
var started = -42.Seconds().RelativeTo(now); | |
var build = NewFailedBuild(1066, started); | |
var result = sut.GetBuildDescription(build, false, now); | |
Assert.Equal("Build #1066 failed in 42 seconds.", result); |
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
<html> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/json2/20121008/json2.js"></script> | |
<script> | |
var AggregateRootEntity = | |
function AggregateRootEntityConstructor(options, my) { | |
var that = {}, | |
handlers = options.handlers || {}, | |
changes = []; |
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
public class BottlingMachine { | |
/* Behavior of the machine goes here */ | |
} | |
//collection oriented | |
public interface BottlingMachineRepository { | |
BottlingMachine FindById(BottlingMachineId id); | |
BottlingMachine[] FindAtPlant(PlantId plantId); | |
BottlingMachine[] FindThoseDueForMaintenance(); | |
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 AggregateSource; | |
namespace TheStuff | |
{ | |
class Program | |
{ | |
static void Main() |
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 json | |
class Event(object): | |
def __init__(self, name, data): | |
self.Name = name | |
self.Data = data | |
class AggregateRootEntity(object): |
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.Dynamic; | |
using System.Linq; | |
using AggregateSource; | |
namespace StuffYouCanDo { | |
class Program { | |
static void Main() { | |
var @case = new PolymorphicSingularMeetsDynamicMeetsAnonymousShowCase(); |
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
//TODAY's IMPL | |
public interface IEventComparer | |
{ | |
IEnumerable<EventComparisonDifference> Compare(object expected, object actual); | |
} | |
public interface IResultComparer | |
{ | |
IEnumerable<ResultComparisonDifference> Compare(object expected, object actual); |
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
public class TravisSpecs { | |
[Test] | |
public void WhenTravisGetsIntoAnotherFight() { | |
new ScenarioBuilder(). | |
Given(TheStoryOfWhatHappenedToTravis()) | |
When(TravisGetsInToANewFight()). | |
Then(HeRuns()). | |
Assert(); | |
} |
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
public class ChildRepository { | |
public Optional<Child> GetOptional(string identifier) { | |
//Very simple parent-child example | |
var childStream =_streamReader.Read(identifier); | |
var parentId = ((SomeInitialEvent)stream.Events[0]).ParentId; | |
var parentStream = _streamReader.Read(parentId); | |
var root = new Child(); | |
root.Initialize(parentStream.Events); |