1
0
Fork 0

Remove Date string from FullName() since it was redundant anyways

main
Sebastian Schulze 2022-03-24 00:12:30 +01:00
parent 1d9281b00a
commit 0ce59385da
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
2 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ func (document Document) Args() []string {
func (document Document) FullName() string {
return document.Date.Format("2006-01-02-150405") + "-" + document.Name
return document.Name
}
func (document Document) FullNameWithExtension() string {

View File

@ -9,21 +9,21 @@ import (
func TestDocumentFullName(t *testing.T) {
document := Document{
Id: "test-uuid",
Name: "Here-Be-A-Test-Name",
Name: "2022-01-01-Here-Be-A-Test-Name",
Date: time.Date(2020, 10, 12, 20, 15, 00, 0, time.UTC),
Duplex: true,
Events: make(chan Event),
}
if document.FullName() != "2020-10-12-201500-Here-Be-A-Test-Name" {
if document.FullName() != "2022-01-01-Here-Be-A-Test-Name" {
t.Error("Full name incorrect" + document.FullName())
}
if document.FullNameWithExtension() != "2020-10-12-201500-Here-Be-A-Test-Name.pdf" {
if document.FullNameWithExtension() != "2022-01-01-Here-Be-A-Test-Name.pdf" {
t.Error("Full name with extension incorrect" + document.FullName())
}
if reflect.DeepEqual(document.Args(), []string{"-d", "2020-10-12-201500-Here-Be-A-Test-Name.pdf"}) {
if reflect.DeepEqual(document.Args(), []string{"-d", "2022-01-01-Here-Be-A-Test-Name.pdf"}) {
t.Error("Incorrect arguments")
}
}