public async void GetAlbums_WhereFilteredByUserId_ShouldReturnSingleAlbum() { // ARRANGE var(albums, photos) = DtoBuilder.CreateAlbumsAndPhotos(); var apiStub = ApiClientStub.Create(m => { m.ReturnAlbums(albums) .ReturnPhotos(photos); }); var sut = new PhotoAlbumService(apiStub); // ACT var result = await sut.GetAlbums(a => a.UserId == albums.First().UserId); // ASSERT result.Count().ShouldBe(1); }
public async void GetAlbums_WhereAlbumsAndPhotosReturnedByClient_ShouldReturnCompiledAlbums() { // ARRANGE var(albums, photos) = DtoBuilder.CreateAlbumsAndPhotos(); var apiStub = ApiClientStub.Create(m => { m.ReturnAlbums(albums) .ReturnPhotos(photos); }); var sut = new PhotoAlbumService(apiStub); // ACT var result = await sut.GetAlbums(); // ASSERT result.Count().ShouldBe(albums.Count); }