Documentation ¶
Index ¶
- func New(t testing.TB) (given SPVWalletApplicationFixture, then SPVWalletApplicationAssertions)
- func NewOf(givenSource SPVWalletApplicationFixture, t testing.TB) (given SPVWalletApplicationFixture, then SPVWalletApplicationAssertions)
- type ConfigOpts
- type SPVWalletApplicationAssertions
- type SPVWalletApplicationFixture
- type SPVWalletHttpClientFixture
- type SPVWalletResponseAssertions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(t testing.TB) (given SPVWalletApplicationFixture, then SPVWalletApplicationAssertions)
func NewOf ¶
func NewOf(givenSource SPVWalletApplicationFixture, t testing.TB) (given SPVWalletApplicationFixture, then SPVWalletApplicationAssertions)
Types ¶
type ConfigOpts ¶
type SPVWalletApplicationAssertions ¶
type SPVWalletApplicationAssertions interface {
Response(response *resty.Response) SPVWalletResponseAssertions
}
func Then ¶
func Then(t testing.TB) SPVWalletApplicationAssertions
type SPVWalletApplicationFixture ¶
type SPVWalletApplicationFixture interface { StartedSPVWallet() (cleanup func()) StartedSPVWalletWithConfiguration(opts ...ConfigOpts) (cleanup func()) // HttpClient returns a new http client that can be used to make requests to the spv-wallet server. // It is also failing tests if there are network or invalid request configuration errors, // so the tests can focus on the server response. HttpClient() SPVWalletHttpClientFixture // NewTest creates a new test fixture based on the current one and the provided testing.TB // This is useful if you want to start spv-wallet once and then run multiple t.Run with some calls against this one instance. NewTest(t testing.TB) SPVWalletApplicationFixture }
func Given ¶
func Given(t testing.TB) SPVWalletApplicationFixture
type SPVWalletHttpClientFixture ¶
type SPVWalletHttpClientFixture interface { // ForAnonymous returns a new http client that is configured without any authentication. ForAnonymous() *resty.Client // ForAdmin returns a new http client that is configured with the authentication with default admin xpub. ForAdmin() *resty.Client // ForUser returns a new http client that is configured with the authentication with the xpub of the sender user. ForUser() *resty.Client // ForGivenUser returns a new http client that is configured with the authentication with the xpub of the given user. ForGivenUser(user fixtures.User) *resty.Client }
type SPVWalletResponseAssertions ¶
type SPVWalletResponseAssertions interface { IsOK() SPVWalletResponseAssertions WithJSONf(expectedFormat string, args ...any) IsUnauthorized() // IsUnauthorizedForAdmin asserts that the response status code is 401 and the error is that admin is not authorized to use the endpoint. IsBadRequest() SPVWalletResponseAssertions }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.