Documentation
¶
Overview ¶
Package providertest provides conformance tests for CallSystem provider implementations.
Provider implementations can use this package to verify they correctly implement the callsystem.CallSystem interface with consistent behavior.
Basic usage:
func TestConformance(t *testing.T) {
p, err := New(WithAccountSID(sid), WithAuthToken(token), WithPhoneNumber(phone))
if err != nil {
t.Fatal(err)
}
providertest.RunAll(t, providertest.Config{
Provider: p,
SkipIntegration: phone == "",
TestPhoneNumber: phone,
TestFromNumber: phone,
})
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunBehaviorTests ¶
RunBehaviorTests runs only behavioral contract tests.
func RunIntegrationTests ¶
RunIntegrationTests runs only integration tests (requires API credentials).
func RunInterfaceTests ¶
RunInterfaceTests runs only interface compliance tests. These tests verify the provider correctly implements the interface contract and do not require API credentials.
Types ¶
type Config ¶
type Config struct {
// Provider is the CallSystem provider implementation to test.
Provider callsystem.CallSystem
// SkipIntegration skips tests that require real API calls.
SkipIntegration bool
// TestPhoneNumber is the number to call for integration tests (E.164 format).
// Required if SkipIntegration is false.
TestPhoneNumber string
// TestFromNumber is the caller ID for outbound calls (E.164 format).
// Required if SkipIntegration is false.
TestFromNumber string
// Timeout for individual test operations.
// Defaults to 30 seconds if zero.
Timeout time.Duration
}
Config configures the callsystem conformance test suite.
Click to show internal directories.
Click to hide internal directories.