This commit is contained in:
Dan Anglin 2024-01-14 12:27:48 +00:00
parent db65a51c66
commit 5837c637a1
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
4 changed files with 31 additions and 31 deletions

View file

@ -12,10 +12,10 @@ func (e CardNotExistError) Error() string {
// Card represents a card on a Kanban board. // Card represents a card on a Kanban board.
type Card struct { type Card struct {
ID int ID int
Title string Title string
Description string Description string
Created string Created string
} }
// UpdateId updates the ID of the Card value. // UpdateId updates the ID of the Card value.

View file

@ -58,7 +58,7 @@ func testCreateCard(kanban board.Board, title, content string, expectedCardID, e
t.Log("When the card is created and saved to the database.") t.Log("When the card is created and saved to the database.")
args := board.CardArgs{ args := board.CardArgs{
NewTitle: title, NewTitle: title,
NewDescription: content, NewDescription: content,
} }
@ -123,7 +123,7 @@ func testUpdateCard(kanban board.Board, cardID int, newTitle, newContent, timest
args := board.UpdateCardArgs{ args := board.UpdateCardArgs{
CardID: cardID, CardID: cardID,
CardArgs: board.CardArgs{ CardArgs: board.CardArgs{
NewTitle: newTitle, NewTitle: newTitle,
NewDescription: newContent, NewDescription: newContent,
}, },
} }
@ -138,10 +138,10 @@ func testUpdateCard(kanban board.Board, cardID int, newTitle, newContent, timest
} }
want := board.Card{ want := board.Card{
ID: cardID, ID: cardID,
Title: newTitle, Title: newTitle,
Description: newContent, Description: newContent,
Created: timestamp, Created: timestamp,
} }
if !reflect.DeepEqual(got, want) { if !reflect.DeepEqual(got, want) {
@ -159,7 +159,7 @@ func testUpdateCardContent(kanban board.Board, cardID int, expectedTitle, newCon
args := board.UpdateCardArgs{ args := board.UpdateCardArgs{
CardID: cardID, CardID: cardID,
CardArgs: board.CardArgs{ CardArgs: board.CardArgs{
NewTitle: "", NewTitle: "",
NewDescription: newContent, NewDescription: newContent,
}, },
} }
@ -174,10 +174,10 @@ func testUpdateCardContent(kanban board.Board, cardID int, expectedTitle, newCon
} }
want := board.Card{ want := board.Card{
ID: cardID, ID: cardID,
Title: expectedTitle, Title: expectedTitle,
Description: newContent, Description: newContent,
Created: timestamp, Created: timestamp,
} }
if !reflect.DeepEqual(got, want) { if !reflect.DeepEqual(got, want) {

View file

@ -163,8 +163,8 @@ func TestReadAndWriteCards(t *testing.T) {
}() }()
singleCard := board.Card{ singleCard := board.Card{
ID: -1, ID: -1,
Title: "A test task.", Title: "A test task.",
Description: "This task should be completed.", Description: "This task should be completed.",
} }
@ -173,18 +173,18 @@ func TestReadAndWriteCards(t *testing.T) {
manyCards := []board.Card{ manyCards := []board.Card{
{ {
ID: -1, ID: -1,
Title: "Test card A.", Title: "Test card A.",
Description: "This is test card A.", Description: "This is test card A.",
}, },
{ {
ID: -1, ID: -1,
Title: "Test card B.", Title: "Test card B.",
Description: "This is test card B.", Description: "This is test card B.",
}, },
{ {
ID: -1, ID: -1,
Title: "Test card C.", Title: "Test card C.",
Description: "This is test card C.", Description: "This is test card C.",
}, },
} }
@ -223,8 +223,8 @@ func testReadOneCard(t *testing.T, database *bolt.DB, cardID int) {
} }
want := board.Card{ want := board.Card{
ID: 1, ID: 1,
Title: "A test task.", Title: "A test task.",
Description: "This task should be completed.", Description: "This task should be completed.",
} }
@ -278,18 +278,18 @@ func testReadManyCards(t *testing.T, database *bolt.DB, cardIDs []int) {
want := []board.Card{ want := []board.Card{
{ {
ID: 2, ID: 2,
Title: "Test card A.", Title: "Test card A.",
Description: "This is test card A.", Description: "This is test card A.",
}, },
{ {
ID: 3, ID: 3,
Title: "Test card B.", Title: "Test card B.",
Description: "This is test card B.", Description: "This is test card B.",
}, },
{ {
ID: 4, ID: 4,
Title: "Test card C.", Title: "Test card C.",
Description: "This is test card C.", Description: "This is test card C.",
}, },
} }
@ -326,8 +326,8 @@ func TestDeleteOneCard(t *testing.T) {
// Create one card, get card ID. // Create one card, get card ID.
card := board.Card{ card := board.Card{
ID: -1, ID: -1,
Title: "Test card", Title: "Test card",
Description: "", Description: "",
} }

View file

@ -54,7 +54,7 @@ func Build() error {
build := sh.RunCmd("go", "build") build := sh.RunCmd("go", "build")
args:= []string{"-ldflags="+flags, "-o", binary} args := []string{"-ldflags=" + flags, "-o", binary}
if os.Getenv("PELICAN_BUILD_REBUILD_ALL") == "1" { if os.Getenv("PELICAN_BUILD_REBUILD_ALL") == "1" {
args = append(args, "-a") args = append(args, "-a")