Esempio n. 1
0
        public async Task Add_new_source_store_new_added_event()
        {
            var command = new AddMediaCommand(
                "marianne",
                "https://www.marianne.net/sites/default/themes/marianne/images/logo-marianne.svg",
                PoliticalOrientation.Left,
                new[] {
                "https://www.marianne.net/rss_marianne.xml"
            }
                );

            await CommandDispatcher.Dispatch <AddMediaCommand, Guid>(command);

            (await EventStore.GetNewEvents())
            .Should()
            .BeEquivalentTo(new DomainEvent[] {
                new MediaAdded(default, command.Name, command.ImageUrl, command.PoliticalOrientation),
 public Task <MediaItem> AddPostMediaAsync(int postId, AddMediaCommand command)
 {
     return(api.PostAsync <AddMediaCommand, MediaItem>(GetPostMediaPath(postId), command));
 }