private void SetupCreated(int value) { HandleEvent handleEvent = x => { }; var version = -1; A.CallTo(() => persistence.ReadAsync(-2)) .Invokes(() => { version = 0; handleEvent(Envelope.Create(new ValueChanged { Value = value })); }); A.CallTo(() => store.WithEventSourcing(typeof(MyLogDomainObject), id, A <HandleEvent> .Ignored)) .Invokes(args => { handleEvent = args.GetArgument <HandleEvent>(2); }) .Returns(persistence); A.CallTo(() => persistence.Version) .ReturnsLazily(() => version); sut.Setup(id); }
private async Task SetupCreatedAsync() { sut.Setup(id); await sut.ExecuteAsync(new CreateAuto { Value = 4 }); }