Skip to content

Coverage: BuildBot.Discord — DiscordChannelAdapter needs integration-test coverage #374

Description

@dnyw4l3n13

Problem

DiscordChannelAdapter in BuildBot.Discord wraps Discord.Net's sealed concrete SocketTextChannel type. All its methods require a live Discord WebSocket connection and cannot be exercised in unit tests:

  • DiscordChannelAdapter(SocketTextChannel) constructor — requires a real SocketTextChannel
  • get_Name — calls _channel.Name on a live channel
  • EnterTypingState() — calls _channel.EnterTypingState() on a live channel
  • SendMessageAsync(Embed) — calls _channel.SendMessageAsync(...) on a live channel

Similarly, the success path of DiscordSocketClientAdapter.FindChannel (where a guild and text channel are found and a DiscordChannelAdapter is returned) is only reachable with a real Discord connection.

The infrastructure-dependent methods of DiscordSocketClientAdapter are also unreachable in unit tests:

  • LoginAsync / StartAsync / StopAsync / LogoutAsync / SetGameAsync — all call Discord API

What needs to happen

Create BuildBot.Discord.Integration.Tests (or extend an existing integration test project) to cover these paths against a real or stubbed Discord connection.

Related to #357.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI-WorkWork for an AI AgentTech DebtTechnical debtbuildbot-discordChanges in BuildBot.Discord project

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions