testutils

package
v0.0.0-...-587043a Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbConnection *pgx.Conn
View Source
var ExampleBook = &entities.Book{
	BookID:          "book_id",
	Title:           "book_title",
	Author:          "book_Author",
	Genre:           "book_genre",
	PublicationDate: "99.99.9999",
	Publisher:       "book_publisher",
	ISBN:            "book_isbn",
	PageCount:       20,
	ShelfNumber:     "book_shelf",
	Language:        "book_language",
	Donor:           "book_donor",
}
View Source
var ExampleBorrowedBook = &entities.BorrowedBook{
	BorrowID:     "borrow_id",
	StudentID:    "student_id",
	BookID:       "book_id",
	BorrowDate:   "borrow_date",
	DeliveryDate: "delivery_date",
	IsExtended:   false,
}
View Source
var ExampleStudent = &entities.Student{
	StudentID:       "student_id",
	StudentMail:     "student_mail",
	StudentPassword: "student_password",
	Debit:           20,
	BookLimit:       20,
	IsBanned:        false,
}

Functions

func CleanupTestDataAuthenticateEmployee

func CleanupTestDataAuthenticateEmployee(db *pgx.Conn, employeeMail string) error

func CleanupTestDataBook

func CleanupTestDataBook(db *pgx.Conn) error

func CleanupTestDataBookBorrow

func CleanupTestDataBookBorrow(db *pgx.Conn) error

func CleanupTestDataCreateBook

func CleanupTestDataCreateBook(db *pgx.Conn, bookID string) error

func CleanupTestDataCreateEmployee

func CleanupTestDataCreateEmployee(db *pgx.Conn, employeeMail string) error

func CleanupTestDataDeleteBook

func CleanupTestDataDeleteBook(db *pgx.Conn, bookID string) error

func CleanupTestDataDeleteEmployee

func CleanupTestDataDeleteEmployee(db *pgx.Conn, employeeID string) error

func CleanupTestDataGetBook

func CleanupTestDataGetBook(db *pgx.Conn, bookID string) error

func CleanupTestDataGetBooks

func CleanupTestDataGetBooks(db *pgx.Conn, books []*entities.Book) error

func CleanupTestDataStudent

func CleanupTestDataStudent(db *pgx.Conn) error

func CloseDatabase

func CloseDatabase()

func InitializeDatabase

func InitializeDatabase() (*pgx.Conn, error)

func SetupTestDataAuthenticateEmployee

func SetupTestDataAuthenticateEmployee(db *pgx.Conn, email, username, phoneNumber, position, password string) error

func SetupTestDataBook

func SetupTestDataBook(db *pgx.Conn, book *entities.Book) error

func SetupTestDataBookBorrow

func SetupTestDataBookBorrow(db *pgx.Conn, bookBorrow *entities.BorrowedBook) error

func SetupTestDataCreateBook

func SetupTestDataCreateBook(db *pgx.Conn, book *entities.Book) error

utils

func SetupTestDataCreateEmployee

func SetupTestDataCreateEmployee(db *pgx.Conn, email string) error

func SetupTestDataDeleteBook

func SetupTestDataDeleteBook(db *pgx.Conn, bookID string) error

func SetupTestDataDeleteEmployee

func SetupTestDataDeleteEmployee(db *pgx.Conn, id string) error

func SetupTestDataGetBook

func SetupTestDataGetBook(db *pgx.Conn, bookID string) error

func SetupTestDataGetBooks

func SetupTestDataGetBooks(db *pgx.Conn, books []*entities.Book) error

func SetupTestDataStudent

func SetupTestDataStudent(db *pgx.Conn, student *entities.Student) error

func TestMain

func TestMain(m *testing.M)

Types

This section is empty.

Jump to

Keyboard shortcuts

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