public async Task Given_MostRecent_Banlist_Query_If_No_Banlists_Are_Found_Banlist_Collection_Should_Empty()
        {
            // Arrange
            var query = new MostRecentBanlistsQuery();

            _banlistService.MostRecentBanlists().Returns(new MostRecentBanlistResult {
                Banlists = new List <MostRecentBanlist>()
            });

            // Act
            var result = await _sut.Handle(query, CancellationToken.None);

            // Assert
            result.Banlists.Should().BeNull();
        }
Ejemplo n.º 2
0
        public async Task <MostRecentBanlistResultOutput> Handle(MostRecentBanlistsQuery request, CancellationToken cancellationToken)
        {
            var response = new MostRecentBanlistResultOutput();

            var result = await _banlistService.MostRecentBanlists();

            if (result.Banlists.Any())
            {
                response.Banlists = result.Banlists.Select(MostRecentBanlistOutputModel.From).ToList();
            }

            return(response);
        }