示例#1
0
        public void GetPlaylistPaginationAsync_ReturnsOutOfRangeException()
        {
            var sut = new PlaylistServiceBuilder()
                      .Build();

            Func <Task> action = async()
                                 => await sut.GetPlaylistPaginationAsync(0, 42, CancellationToken.None);

            action.Should().Throw <ArgumentOutOfRangeException>();
        }
示例#2
0
        public async Task GetPlaylistPaginationAsync_CallsAudioRepository()
        {
            var repository = Substitute.For <IPlaylistEntriesRepository>();
            var sut        = new PlaylistServiceBuilder()
                             .WithPlaylistRepository(repository)
                             .Build();

            await sut.GetPlaylistPaginationAsync(2, 1, CancellationToken.None);

            await repository.Received().GetRangeAsync(1, 1, CancellationToken.None);
        }
示例#3
0
        public async Task GetPlaylistPaginationAsync_ReturnsNonNull()
        {
            var repository = Substitute.For <IPlaylistEntriesRepository>();
            var sut        = new PlaylistServiceBuilder()
                             .WithPlaylistRepository(repository)
                             .Build();

            var actual = await sut.GetPlaylistPaginationAsync(1, 1, CancellationToken.None);

            actual.Should().NotBeNull();
        }