Remove Date string from FullName() since it was redundant anyways
This commit is contained in:
parent
1d9281b00a
commit
0ce59385da
2 changed files with 5 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue