예제 #1
0
        public async Task GetAllAsync_HasNoAlbums_OKWithEmptyList()
        {
            var albums = new List <Album>();

            _albumServiceMock.Setup(x => x.GetAlbumsAsync())
            .ReturnsAsync(albums);

            var response = await _albumController.GetAllAsync();

            Assert.IsNotNull(response);
            Assert.IsInstanceOfType(response, typeof(IEnumerable <AlbumDetails>));
            Assert.IsFalse(response.Any());
        }
예제 #2
0
        public async Task GetAllAlbumsAsync_ShouldReturnNotNull()
        {
            //Arrange

            //Act
            var result = await _controller.GetAllAsync();

            List <Album> albums = result.ToList();

            //Assert
            Assert.IsNotNull(albums);
            Assert.AreEqual(albums.Count, GetTestAlbums().ToList().Count);
        }