public async Task GetRandomAsync_WhenFound_ReturnsShortUrl()
        {
            var expectedAdverb    = GenerateWord <Adverb>(false, false);
            var expectedAdjective = GenerateWord <Adjective>(false, false);
            var expectedNoun      = GenerateWord <Noun>(false, false);
            var expectedUrl       = new Url
            {
                DateCreated = DateTimeOffset.UtcNow,
                TargetUrl   = "https://localhost/"
            };

            _wordsServiceMock.Setup(m => m.GetWordByIdAsync <Adverb>(It.IsAny <int>()))
            .ReturnsAsync(expectedAdverb);
            _wordsServiceMock.Setup(m => m.GetWordByIdAsync <Adjective>(It.IsAny <int>()))
            .ReturnsAsync(expectedAdjective);
            _wordsServiceMock.Setup(m => m.GetWordByIdAsync <Noun>(It.IsAny <int>()))
            .ReturnsAsync(expectedNoun);
            _urlServiceMock.Setup(m => m.GetRandomAsync(It.IsAny <string>())).ReturnsAsync(expectedUrl);

            var repository = new ShortUrlRepository(_urlServiceMock.Object, _wordsServiceMock.Object, _configuration);
            var actual     = await repository.GetRandomAsync("en");

            Assert.Equal(expectedAdverb.Id, actual.Adverb.Id);
            Assert.Equal(expectedAdverb.Value, actual.Adverb.Value);
            Assert.Equal(expectedAdjective.Id, actual.Adjective.Id);
            Assert.Equal(expectedAdjective.Value, actual.Adjective.Value);
            Assert.Equal(expectedNoun.Id, actual.Noun.Id);
            Assert.Equal(expectedNoun.Value, actual.Noun.Value);
            Assert.Equal("https://localhost/", actual.BaseDomain);
            Assert.Equal(expectedUrl.TargetUrl, actual.TargetUrl);
            Assert.Equal(expectedUrl.DateCreated, actual.DateCreated);
            Assert.Equal($"https://localhost/{expectedAdverb.Value}{expectedAdjective.Value}{expectedNoun.Value}",
                         actual.FullUri.ToString());
        }
 public async Task GetRandomAsync_WhenNotFound_Throws()
 {
     var repository = new ShortUrlRepository(_urlServiceMock.Object, _wordsServiceMock.Object, _configuration);
     await Assert.ThrowsAsync <InvalidOperationException>(() => repository.GetRandomAsync("en"));
 }