Skip to content

Instantly share code, notes, and snippets.

@jen20
Created July 27, 2013 18:37
Show Gist options
  • Save jen20/6095829 to your computer and use it in GitHub Desktop.
Save jen20/6095829 to your computer and use it in GitHub Desktop.
Potential syntax for constructor testing in AggregateSource
[Test]
public void ConstructorSucceeeds()
{
var id = new ConcertId(Guid.NewGuid());
new ConstructorScenario()
.When(() => Concert.New(id))
.Then(ConcertEvents.Planned(id))
.Assert();
}
[Test]
public void ConstructorThrows()
{
new ConstructorScenario()
.When(() => Concert.New(new ConcertId(Guid.NewGuid()), true))
.AssertThrows(new ArgumentException("shouldThrow"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment