Пример #1
0
        public async Task Create_should_create_events_and_update_state()
        {
            var command = new CreateAssetFolder {
                FolderName = "New Name"
            };

            var result = await sut.ExecuteAsync(CreateAssetFolderCommand(command));

            result.ShouldBeEquivalent(sut.Snapshot);

            Assert.Equal(command.FolderName, sut.Snapshot.FolderName);

            LastEvents
            .ShouldHaveSameEvents(
                CreateAssetFolderEvent(new AssetFolderCreated
            {
                FolderName = command.FolderName
            })
                );
        }
Пример #2
0
        private async Task <object?> PublishAsync(AssetFolderCommand command)
        {
            var result = await sut.ExecuteAsync(CreateAssetFolderCommand(command));

            return(result.Value);
        }