public void GetPlaylistPaginationAsync_ReturnsOutOfRangeException() { var sut = new PlaylistServiceBuilder() .Build(); Func <Task> action = async() => await sut.GetPlaylistPaginationAsync(0, 42, CancellationToken.None); action.Should().Throw <ArgumentOutOfRangeException>(); }
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); }
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(); }