Exemplo n.º 1
0
        protected override void Given()
        {
            ReloadedAccountAggregateRoot = AggregateRootFactory.Create <NonDisposingAccountAggregateRoot>();
            ReloadedAccountAggregateRoot.InitialiseAccount(AggregateId, "account-id");
            ReloadedAccountAggregateRoot.AddAmount(2.00M);

            // intermediate save should cause a concurrency error when we save below
            Subject.Save(ReloadedAccountAggregateRoot);

            ReloadedAccountAggregateRoot.AddAmount(5.00M);
        }
        protected override void Given()
        {
            var aggregate = AggregateRootFactory.Create <AccountAggregateRoot>();

            aggregate.InitialiseAccount(AggregateId, "account-id");
            aggregate.AddAmount(2.00M);
            Subject.Save(aggregate);

            ReloadedAccountAggregateRoot = Subject.Get(AggregateId);
            ReloadedAccountAggregateRoot.AddAmount(5.00M);
            Subject.Save(ReloadedAccountAggregateRoot);
        }
 public void no_exception_is_thrown_and_a_new_aggregate_is_returned() => ReloadedAccountAggregateRoot
 .ShouldNotBeNull();