tests

package
v0.1.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

* File Created: Sunday, 30th July 2023 3:57:52 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpMockResJSON

func HttpMockResJSON(statusCode int, filePath string, headers map[string]string) httpmock.Responder

func StringToTime

func StringToTime(timeString string) time.Time

StringToTime return string to time without return error. If when parsing encounters an error, it will return the default value

func ToPtr

func ToPtr[V any](value V) *V

ToPtr return value pointer for anything data types.

Types

type Feature

type Feature struct {
	Ctrl      *gomock.Controller
	ServerKey string
}

func FeatureWrap

func FeatureWrap(t *testing.T) *Feature

func (*Feature) DeepEqualPayload

func (f *Feature) DeepEqualPayload(fileJson string, payload any, argPayload any) bool

DeepEqualPayload checks whether the payload for the request matches the example json or not. Value payload and argPayload must be assign as pointer

func (*Feature) DeepEqualResponse

func (f *Feature) DeepEqualResponse(gotRes any, wantRes any) bool

DeepEqualResponse is used to check responses that have interface values

func (*Feature) ResJSONByte

func (f *Feature) ResJSONByte(jsonFile string) []byte

Directories

Path Synopsis
Package mock_common is a generated GoMock package.
Package mock_common is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL