Skip to content

Instantly share code, notes, and snippets.

View bwatts's full-sized avatar

Bryan Watts bwatts

View GitHub Profile
public class WorkItem : Aggregate
{
public WorkItem(EntityId id, string description, TimeSpan retryInterval)
{
Announce(new WorkItemCreatedEvent(id, description, retryInterval));
}
public string Description { get; private set; }
public Progress Progress { get; private set; }
public TimeSpan RetryInterval { get; private set; }
@bwatts
bwatts / NoBaseClass.cs
Created October 19, 2012 00:33
Behaviors with LINQ syntax using a scenario monad
public class IntervalComparisons
{
[Scenario]
public void Linq_NoBaseClass()
{
var result =
from left in "Given an interval".Of(Interval.WholeStep)
from right in "And a lesser interval".Of(Interval.HalfStep)
select "When comparing them".Do(left.CompareTo(right));