Skip to content

Commit

Permalink
增加测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
ichiro999 committed Apr 6, 2021
1 parent 1817329 commit 5f51a59
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions env/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,22 @@ func TestSplitNamespaces(t *testing.T) {
Assert(t, l, Equal(3))
w.Wait()
}

func TestNotificationsMap(t *testing.T) {
appConfig.Init()
ID := appConfig.GetNotificationsMap().GetNotify("application")
Assert(t, ID, Equal(int64(-1)))

appConfig.GetNotificationsMap().UpdateNotify("application", 3)
newID := appConfig.GetNotificationsMap().GetNotify("application")
Assert(t, newID, Equal(int64(3)))

appConfig.GetNotificationsMap().UpdateNotify("", 100)
noID := appConfig.GetNotificationsMap().GetNotify("")
Assert(t, noID, Equal(int64(0)))

appConfig.GetNotificationsMap().UpdateNotify("noExistNS", 3)
noExistID := appConfig.GetNotificationsMap().GetNotify("noExistNs")
Assert(t, noExistID, Equal(int64(0)))

}

0 comments on commit 5f51a59

Please sign in to comment.