test

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(t *testing.T, got, want any)

func AssertErrorContains

func AssertErrorContains(t *testing.T, got error, want string)

func AssertErrorIs

func AssertErrorIs(t *testing.T, got error, want error)

func AssertNilError

func AssertNilError(t *testing.T, got error)

func AssertNotEqual

func AssertNotEqual(t *testing.T, got, notwant any)

func AssertSliceContains

func AssertSliceContains[T comparable](t *testing.T, got []T, want T)

func AssertStringContains

func AssertStringContains(t *testing.T, got, want string)

func CreateBlog

func CreateBlog(t *testing.T, store *storage.Storage) *admin.Blog

mocks a blog and creates it in the database

func CreatePost

func CreatePost(t *testing.T, store *storage.Storage) *admin.Post

mocks a post and creates it in the database

func CreateTag

func CreateTag(t *testing.T, store *storage.Storage) *admin.Tag

mocks a tag and creates it in the database

func NewBlog

func NewBlog() *admin.Blog

func NewConfig

func NewConfig(t *testing.T) config.Config

func NewPost

func NewPost(blog *admin.Blog) *admin.Post

func NewTag

func NewTag() *admin.Tag

func RandomString

func RandomString(n int) string

func RandomTime

func RandomTime() time.Time

func RandomURL

func RandomURL(n int) string

Types

type CloserFunc

type CloserFunc func()

func NewDatabase

func NewDatabase(t *testing.T) (postgres.Conn, CloserFunc)

func NewStorage

func NewStorage(t *testing.T) (*storage.Storage, CloserFunc)

Jump to

Keyboard shortcuts

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