Skip to content

C# SDK: Add Interface Generation for Better Testability #422

Description

@kewur

I’ve been integrating the SnapTrade C# SDK into our platform, but one thing that’s made it a bit tricky is the lack of interfaces on the generated API classes.

Since everything like AccountInformationApi or ConnectionsApi is a concrete class, it’s really hard to mock them cleanly in unit tests in C# due to mocking libraries inability to mock concrete classes (only interfaces and virtual methods can be mocked). In most modern C# projects (especially with DI and test-first workflows), it’s pretty standard to rely on interfaces so we can easily swap things out during testing.

Right now, I’m having to wrap the SDK in my own interfaces just to get basic test coverage, which feels like something the SDK could easily support out of the box.

I get that this is a generated SDK and you probably support a bunch of languages, but having interfaces in just the C# version would make a big difference for teams using it in real production setups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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