Example #1
0
        public void LibraryItemBookmarkSetEmojiWorks()
        {
            LibraryItem item = new LibraryItem(_eventFactory, "foo/bar.mp3");

            LibraryItemBookmarkAddedEvent addBookmarkEvent = _eventFactory.GetBookmarkAddedEvent(item.AggregateId, Guid.NewGuid(), TimeSpan.FromSeconds(42));

            item.Apply(addBookmarkEvent);

            item.Bookmarks.Single();
            item.Apply(_eventFactory.GetBookmarkSetEmojiEvent(item.AggregateId, addBookmarkEvent.BookmarkId, "🎶"));

            item.Bookmarks.Single().Emoji.Should().Be("🎶");
        }
Example #2
0
        public void LibraryItemDeleteBookmarkWorks()
        {
            LibraryItem item = new LibraryItem(_eventFactory, "foo/bar.mp3");

            item.Bookmarks.Count.Should().Be(0);

            LibraryItemBookmarkAddedEvent addBookmarkEvent = _eventFactory.GetBookmarkAddedEvent(item.AggregateId, Guid.NewGuid(), TimeSpan.FromSeconds(42));

            item.Apply(addBookmarkEvent);

            Bookmark bookmark = item.Bookmarks.Single();

            item.Apply(_eventFactory.GetBookmarkDeletedEvent(item.AggregateId, addBookmarkEvent.BookmarkId));

            item.Bookmarks.Should().BeEmpty();
        }
Example #3
0
        public void LibraryItemAddBookmarkWorks()
        {
            LibraryItem item = new LibraryItem(_eventFactory, "foo/bar.mp3");

            item.Bookmarks.Count.Should().Be(0);

            LibraryItemBookmarkAddedEvent addBookmarkEvent = _eventFactory.GetBookmarkAddedEvent(item.AggregateId, Guid.NewGuid(), TimeSpan.FromSeconds(42));

            item.Apply(addBookmarkEvent);

            Bookmark bookmark = item.Bookmarks.Single();

            bookmark.Position.Should().Be(TimeSpan.FromSeconds(42));
            bookmark.Emoji.Should().BeNull();
            bookmark.Comment.Should().BeNull();
        }