public void ApplyUpdatesTheState() { var state = "testdata"; var target = new AggregateBuilder().WithCommand(state).Build(); Assert.Equal("testdata", target.TestData); }
public void CanLoadNewAggregateToExactState() { var old = new AggregateBuilder().WithCommand().Build(); var loaded = new TestAggregate(); loaded.Load(old.PendingEvents()); Assert.Equal(old, loaded); }
public async Task AllEventsAreLoadedUpProperly() { var agg = new AggregateBuilder() .WithAppend("1") .WithAppend("2") .WithAppend("3") .WithCommand("*") .Build(); var harness = new RepoBuilder() .WithAggregate(agg) .Build(); await harness.Save(); var agg2 = await harness.Load(agg.Id); Assert.Equal(agg, agg2); }
public void ApplyIncrementsTheVersion() { var target = new AggregateBuilder().WithCommand().Build(); Assert.Equal(1, target.Version); }