Skip to content

Instantly share code, notes, and snippets.

@yreynhout
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yreynhout/7780025cd5807e95a00a to your computer and use it in GitHub Desktop.
Save yreynhout/7780025cd5807e95a00a to your computer and use it in GitHub Desktop.
using Projac;
using Projac.Testing;
using Projac.Testing.NUnit;
using NUnit.Framework;
[TestFixture]
public class PortfolioProjectionTests
{
[Test]
public void PhotoCountIsDecrementedWhenPhotoIsRemoved()
{
new Scenario(Projections.Portfolio).
Given(PortfolioAdded()).
Given(PortfolioRenamed()).
Given(PhotoAddedToPortfolio()).
Given(PhotoAddedToPortfolio()).
When(PhotoRemovedFromPortfolio()).
ExpectNonEmptyResultSet(
TSql.Query("SELECT * FROM [Portfolio] WHERE [Id] = {0} AND [PhotoCount] = {1}",
TSql.Int(PortfolioId),
TSql.Int(1))).
Assert();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment