sm: added todos
This commit is contained in:
parent
462749bbb9
commit
950f9098ab
2 changed files with 8 additions and 0 deletions
|
|
@ -13,16 +13,22 @@ import (
|
||||||
func TestCreateNoteHandlerOnSucess(t *testing.T) {
|
func TestCreateNoteHandlerOnSucess(t *testing.T) {
|
||||||
|
|
||||||
// Arrange
|
// Arrange
|
||||||
|
// TODO: move to test vars and main_test.go
|
||||||
db, err := sql.Open("sqlite", test.NewTestVars().DbPath)
|
db, err := sql.Open("sqlite", test.NewTestVars().DbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to open database: %v", err)
|
t.Fatalf("failed to open database: %v", err)
|
||||||
}
|
}
|
||||||
defer db.Close()
|
defer db.Close()
|
||||||
|
|
||||||
uow := repositories.NewUnitOfWork(db)
|
uow := repositories.NewUnitOfWork(db)
|
||||||
|
|
||||||
handler := handlers.NewCreateNoteHandler(uow)
|
handler := handlers.NewCreateNoteHandler(uow)
|
||||||
|
|
||||||
|
// TODO: add to test vars and move to main_test.go
|
||||||
|
ctx := test.Context()
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package test
|
||||||
|
|
||||||
import "os"
|
import "os"
|
||||||
|
|
||||||
|
// todo: move into main_test.go and add utility functions in there
|
||||||
type TestVars struct {
|
type TestVars struct {
|
||||||
DbPath string
|
DbPath string
|
||||||
}
|
}
|
||||||
|
|
@ -12,3 +13,4 @@ func NewTestVars() *TestVars {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue