Ejemplo n.º 1
0
    public void Channel_slug_can_be_parsed_from_a_URL_string(string channelUrl, string expectedChannelSlug)
    {
        // Act
        var parsed = ChannelSlug.Parse(channelUrl);

        // Assert
        parsed.Value.Should().Be(expectedChannelSlug);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the metadata associated with the channel identified by the specified slug or custom URL.
 /// </summary>
 public async ValueTask <Channel> GetBySlugAsync(
     ChannelSlug channelSlug,
     CancellationToken cancellationToken = default) =>
 Extract(await _controller.GetChannelPageAsync(channelSlug, cancellationToken));
Ejemplo n.º 3
0
 public async ValueTask <ChannelPageExtractor> GetChannelPageAsync(
     ChannelSlug channelSlug,
     CancellationToken cancellationToken = default) =>
 await GetChannelPageAsync("c/" + channelSlug, cancellationToken);
Ejemplo n.º 4
0
 public void Channel_slug_cannot_be_parsed_from_an_invalid_string(string channelSlugOrUrl)
 {
     // Act & assert
     Assert.Throws <ArgumentException>(() => ChannelSlug.Parse(channelSlugOrUrl));
 }