testutil

package
v0.0.0-...-a18f44e Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbName = "datauxtest"
)

Variables

View Source
var (
	Articles = make([]*Article, 0)
	Users    = make([]*User, 0)
)
View Source
var (
	ArticleCsv = `` /* 398-byte string literal not displayed */

)

Functions

func Setup

func Setup()

func ValidateQuery

func ValidateQuery(t *testing.T, querySql string, expectCols []string, expectColCt, expectRowCt int, rowValidate func([]interface{}))

func ValidateQuerySpec

func ValidateQuerySpec(t *testing.T, testSpec QuerySpec)

Types

type Article

type Article struct {
	Title    string
	Author   string
	Count    int
	Count64  int64
	Deleted  bool
	Category datasource.StringArray
	Created  time.Time
	Updated  *time.Time
	F        float64
	Embedded struct {
		Tag string
		ICt int
	}
	Body *json.RawMessage
}

func (*Article) Header

func (a *Article) Header() string

func (*Article) Row

func (a *Article) Row() string

func (*Article) UrlMsg

func (a *Article) UrlMsg() url.Values

func (*Article) Values

func (a *Article) Values() []interface{}

type QuerySpec

type QuerySpec struct {
	Sql             string
	Exec            string
	Cols            []string
	ValidateRow     func([]interface{})
	ExpectRowCt     int
	ExpectColCt     int
	RowData         interface{}
	ValidateRowData func()
}

type User

type User struct {
	Id      string
	Name    string
	Deleted bool
	Roles   datasource.StringArray
	Created time.Time
	Updated *time.Time
}

func (*User) Header

func (u *User) Header() string

func (*User) Row

func (u *User) Row() string

func (*User) Values

func (u *User) Values() []interface{}

Jump to

Keyboard shortcuts

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