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.
type Card struct {
ID int
Title string
ID int
Title string
Description string
Created string
Created string
}
// 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.")
args := board.CardArgs{
NewTitle: title,
NewTitle: title,
NewDescription: content,
}
@ -123,7 +123,7 @@ func testUpdateCard(kanban board.Board, cardID int, newTitle, newContent, timest
args := board.UpdateCardArgs{
CardID: cardID,
CardArgs: board.CardArgs{
NewTitle: newTitle,
NewTitle: newTitle,
NewDescription: newContent,
},
}
@ -138,10 +138,10 @@ func testUpdateCard(kanban board.Board, cardID int, newTitle, newContent, timest
}
want := board.Card{
ID: cardID,
Title: newTitle,
ID: cardID,
Title: newTitle,
Description: newContent,
Created: timestamp,
Created: timestamp,
}
if !reflect.DeepEqual(got, want) {
@ -159,7 +159,7 @@ func testUpdateCardContent(kanban board.Board, cardID int, expectedTitle, newCon
args := board.UpdateCardArgs{
CardID: cardID,
CardArgs: board.CardArgs{
NewTitle: "",
NewTitle: "",
NewDescription: newContent,
},
}
@ -174,10 +174,10 @@ func testUpdateCardContent(kanban board.Board, cardID int, expectedTitle, newCon
}
want := board.Card{
ID: cardID,
Title: expectedTitle,
ID: cardID,
Title: expectedTitle,
Description: newContent,
Created: timestamp,
Created: timestamp,
}
if !reflect.DeepEqual(got, want) {

View file

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

View file

@ -54,7 +54,7 @@ func Build() error {
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" {
args = append(args, "-a")