public async Task ShouldReturnPhotoAlbumsForGivenUser(int userId) { //arrange var sut = new RunpathApplicationService(jsonPlaceHolderApiClient.Object); //act var result = await sut.GetPhotoAlbumsAsync(userId); //assert Assert.All(result, photoAlbum => Assert.Equal(userId, photoAlbum.UserId)); }
public async Task ShouldReturnAllPhotoAlbums() { //arrange var sut = new RunpathApplicationService(jsonPlaceHolderApiClient.Object); //act var result = await sut.GetPhotoAlbumsAsync(); //assert Assert.Equal(3, result.Count()); }
public async Task ShouldReturnCorrectNumberOfPhotoAlbumsForGivenUser(int userId) { //arrange var sut = new RunpathApplicationService(jsonPlaceHolderApiClient.Object); //act var result = await sut.GetPhotoAlbumsAsync(userId); //assert Assert.Equal(1, result.Count()); }
public async Task ShouldContainCorrectAlbumDetails() { //arrange var testAlbumId = 1; var sut = new RunpathApplicationService(jsonPlaceHolderApiClient.Object); //act var result = (await sut.GetPhotoAlbumsAsync()).SingleOrDefault(pa => pa.AlbumId == testAlbumId); //assert Assert.Equal(1, result.AlbumId); Assert.Equal(1337, result.UserId); Assert.Equal("Test Album", result.Title); Assert.Equal(2, result.Photos.Count); }
public async Task ShouldContainCorrectPhotosDetails() { //arrange var testAlbumId = 1; var sut = new RunpathApplicationService(jsonPlaceHolderApiClient.Object); //act var result = (await sut.GetPhotoAlbumsAsync()).SingleOrDefault(pa => pa.AlbumId == testAlbumId); //assert Assert.Equal(1, result.Photos[0].PhotoId); Assert.Equal(1, result.Photos[0].AlbumId); Assert.Equal("Test Photo 1", result.Photos[0].Title); Assert.Equal("http://test1", result.Photos[0].Url); Assert.Equal("http://testUrl1", result.Photos[0].ThumbnailUrl); Assert.Equal(2, result.Photos[1].PhotoId); Assert.Equal(1, result.Photos[1].AlbumId); Assert.Equal("Test Photo 2", result.Photos[1].Title); Assert.Equal("http://test2", result.Photos[1].Url); Assert.Equal("http://testUrl2", result.Photos[1].ThumbnailUrl); }