test

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAtLeast added in v0.3.7

func AssertAtLeast(t *testing.T, got, want int)

func AssertEqual

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

func AssertErrorAs added in v0.4.0

func AssertErrorAs(t *testing.T, got error, 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 CreateAccount added in v0.3.6

func CreateAccount(t *testing.T, repo *repository.Repository) *model.Account

mocks an account and creates it in the database

func CreateAccountBlog added in v0.4.0

func CreateAccountBlog(t *testing.T, repo *repository.Repository, account *model.Account, blog *model.Blog)

create an account blog in the database

func CreateAccountPage added in v0.5.0

func CreateAccountPage(t *testing.T, repo *repository.Repository, account *model.Account, page *model.Page)

create an account page in the database

func CreateBlog

func CreateBlog(t *testing.T, repo *repository.Repository) *model.Blog

mocks a blog and creates it in the database

func CreatePage added in v0.5.0

func CreatePage(t *testing.T, repo *repository.Repository) *model.Page

mocks a page and creates it in the database

func CreatePost

func CreatePost(t *testing.T, repo *repository.Repository, blog *model.Blog) *model.Post

mocks a post and creates it in the database

func CreateSession added in v0.4.0

func CreateSession(t *testing.T, repo *repository.Repository, account *model.Account) (*model.Session, string)

mocks a session and creates it in the database

func CreateTag

func CreateTag(t *testing.T, repo *repository.Repository) *model.Tag

mocks a tag and creates it in the database

func NewAccount added in v0.3.6

func NewAccount(t *testing.T) *model.Account

func NewBlog

func NewBlog(t *testing.T) *model.Blog

func NewConfig

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

func NewPage added in v0.5.0

func NewPage(t *testing.T) *model.Page

func NewPost

func NewPost(t *testing.T, blog *model.Blog) *model.Post

func NewSession added in v0.4.0

func NewSession(t *testing.T, account *model.Account) (*model.Session, string)

func NewSyncService added in v0.3.6

func NewSyncService(
	t *testing.T,
	repo *repository.Repository,
	feeds map[string]fetch.FetchFeedResponse,
) *service.SyncService

func NewTag

func NewTag(t *testing.T) *model.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 NewFinder added in v0.4.0

func NewFinder(t *testing.T) (*finder.Finder, CloserFunc)

func NewRepository added in v0.4.0

func NewRepository(t *testing.T) (*repository.Repository, CloserFunc)

Jump to

Keyboard shortcuts

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