-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ulrich Lissé
committed
Apr 8, 2019
1 parent
203f7cf
commit 2f6a05c
Showing
8 changed files
with
44 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package datetime | ||
package domain | ||
|
||
import "time" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package datetime | ||
package domain | ||
|
||
import ( | ||
"math" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
package datetime_test | ||
package domain_test | ||
|
||
import ( | ||
"github.com/leanovate/mite-go/datetime" | ||
"github.com/leanovate/mite-go/domain" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func Test_ParseMinutes(t *testing.T) { | ||
expected := datetime.NewMinutes(23) | ||
actual, err := datetime.ParseMinutes("23m") | ||
expected := domain.NewMinutes(23) | ||
actual, err := domain.ParseMinutes("23m") | ||
|
||
assert.Nil(t, err) | ||
assert.Equal(t, expected, actual) | ||
|
||
actual, err = datetime.ParseMinutes("22m33s") | ||
actual, err = domain.ParseMinutes("22m33s") | ||
|
||
assert.Nil(t, err) | ||
assert.Equal(t, expected, actual) | ||
|
||
_, err = datetime.ParseMinutes("1970-01-01") | ||
_, err = domain.ParseMinutes("1970-01-01") | ||
assert.NotNil(t, err) | ||
} | ||
|
||
func TestMinutes_Value(t *testing.T) { | ||
expected := 23 | ||
actual := datetime.NewMinutes(23).Value() | ||
actual := domain.NewMinutes(23).Value() | ||
|
||
assert.Equal(t, expected, actual) | ||
} | ||
|
||
func TestMinutes_String(t *testing.T) { | ||
expected := "23m" | ||
actual := datetime.NewMinutes(23).String() | ||
actual := domain.NewMinutes(23).String() | ||
|
||
assert.Equal(t, expected, actual) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters