✅ Improve test coverage
This commit is contained in:
parent
6f06adc37d
commit
d7de194a90
4 changed files with 75 additions and 0 deletions
25
app_test.go
25
app_test.go
|
|
@ -78,6 +78,31 @@ func TestService(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestAppStorage(t *testing.T) {
|
||||
th := setupAppTest(t)
|
||||
base := "http://localhost:1234/"
|
||||
th.conf.EXPECT().BaseURL().Return(base).MinTimes(1)
|
||||
th.conf.EXPECT().Name().Return("").AnyTimes()
|
||||
a, er := NewApp("0.0.0.0", th.conf, th.store)
|
||||
assert.NoError(t, er)
|
||||
if assert.NotNil(t, a) {
|
||||
assert.Equal(t, th.store, a.Storage())
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppUser(t *testing.T) {
|
||||
// TODO: Actually fill this out at some point
|
||||
th := setupAppTest(t)
|
||||
base := "http://localhost:1234/"
|
||||
th.conf.EXPECT().BaseURL().Return(base).MinTimes(1)
|
||||
th.conf.EXPECT().Name().Return("").AnyTimes()
|
||||
a, er := NewApp("0.0.0.0", th.conf, th.store)
|
||||
assert.NoError(t, er)
|
||||
if assert.NotNil(t, a) {
|
||||
assert.Zero(t, a.User())
|
||||
}
|
||||
}
|
||||
|
||||
func TestStrings(t *testing.T) {
|
||||
cases := [...]struct {
|
||||
given string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue