Documentation
¶
Index ¶
- Variables
- func AssertJSONEqual(t *testing.T, expected, actual string)
- func MockContractResponse() map[string]interface{}
- func MockGraphQLResponse(data interface{}, errors []interface{}) map[string]interface{}
- func MockHTTPResponse(statusCode int, body interface{}) *http.Response
- func MockJobPostingResponse() map[string]interface{}
- func MockOAuth2Token(accessToken string, expiresIn int) map[string]interface{}
- func MockProposalResponse() map[string]interface{}
- func MockTime() time.Time
- func MockUserResponse() map[string]interface{}
- type GraphQLError
- type TestServer
Constants ¶
This section is empty.
Variables ¶
var SampleData = struct { UserID string ContractID string JobPostingID string ProposalID string MilestoneID string OrganizationID string TeamID string RoomID string }{ UserID: "123456789", ContractID: "987654321", JobPostingID: "456789123", ProposalID: "789123456", MilestoneID: "321654987", OrganizationID: "org_123456", TeamID: "team_789", RoomID: "room_456", }
SampleData provides sample data for testing various API responses
Functions ¶
func AssertJSONEqual ¶
AssertJSONEqual asserts that two JSON strings are equal
func MockContractResponse ¶
func MockContractResponse() map[string]interface{}
MockContractResponse creates a mock contract response
func MockGraphQLResponse ¶
func MockGraphQLResponse(data interface{}, errors []interface{}) map[string]interface{}
MockGraphQLResponse creates a mock GraphQL response
func MockHTTPResponse ¶
MockHTTPResponse creates a mock HTTP response with the given status code and body
func MockJobPostingResponse ¶
func MockJobPostingResponse() map[string]interface{}
MockJobPostingResponse creates a mock job posting response
func MockOAuth2Token ¶
MockOAuth2Token creates a mock OAuth2 token response
func MockProposalResponse ¶
func MockProposalResponse() map[string]interface{}
MockProposalResponse creates a mock proposal response
func MockUserResponse ¶
func MockUserResponse() map[string]interface{}
MockUserResponse creates a mock user response
Types ¶
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
Path []interface{} `json:"path,omitempty"`
Locations []map[string]int `json:"locations,omitempty"`
}
GraphQLError represents a GraphQL error
func CreateGraphQLError ¶
func CreateGraphQLError(message string, code string) GraphQLError
CreateGraphQLError creates a GraphQL error for testing
type TestServer ¶
CreateTestServer creates a test HTTP server with custom handlers
func NewTestServer ¶
func NewTestServer() *TestServer
func (*TestServer) Start ¶
func (ts *TestServer) Start(address string)
func (*TestServer) Stop ¶
func (ts *TestServer) Stop()