Esempio n. 1
0
        public async Task GivenAnAggregateWithChangesThenSaveIsCalledAsync()
        {
            var repository = new Mock <IRepository <SerializableAggregateRoot> >();
            var aggregate  = new SerializableAggregateRoot();

            await aggregate.SaveAsync(repository.Object);

            repository.Verify(
                repo => repo.SaveAsync(
                    It.IsAny <SerializableAggregateRoot>(),
                    It.IsAny <CancellationToken?>()),
                Times.Once);
        }