Exemple #1
0
        public async Task CharacterUseCaseTest_GetListAsync_BN004()
        {
            // Arrange
            var comicInput = ComicInputFaker.Create().Generate();

            comicInput.Limit = null;

            // Act
            var exception = await Assert.ThrowsAsync <BusinessException>(async() => await _comicUseCase.GetListAsync(1, comicInput));

            //Assert
            Assert.Contains(ExceptionMessages.BN004, exception.Message);
        }
Exemple #2
0
        public async Task ComicUseCaseTest_GetListAsync_Success()
        {
            // Arrange
            var comicInput       = ComicInputFaker.Create().Generate();
            var comicDataWrapper = ComicDataWrapperFaker.Create().Generate();

            // Setup
            _comicRepository
            .Setup(p => p.GetComicsByCharacter(1, comicInput))
            .Returns(Task.FromResult(comicDataWrapper));

            // Act
            var result = await _comicUseCase.GetListAsync(1, comicInput);

            //Assert
            Assert.True(result.Data.Results.Any());
        }