File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "testing"
5+
6+ "github.com/stretchr/testify/assert"
7+ )
8+
9+ func TestInit (t * testing.T ) {
10+ const expectedUserAgent = "TibiaData-API/v4 (release/unknown; build/manual; commit/-; edition/open-source; unittest.example.com)"
11+
12+ TibiaDataUserAgent = TibiaDataUserAgentGenerator (TibiaDataAPIversion )
13+ assert .Equal (t , expectedUserAgent , TibiaDataUserAgent )
14+ }
15+
16+ func TestTibiaDataInitializer (t * testing.T ) {
17+ assert := assert .New (t )
18+
19+ // Call the function to be tested
20+ TibiaDataInitializer ()
21+
22+ // Check that the variables have been set correctly
23+ assert .Equal ("open-source" , TibiaDataBuildEdition )
24+ assert .Equal ("unittest.example.com" , TibiaDataHost )
25+ }
Original file line number Diff line number Diff line change @@ -240,8 +240,6 @@ func TestFakeToUpCodeCoverage(t *testing.T) {
240240 tibiaWorldsWorld (c )
241241 assert .Equal (http .StatusOK , w .Code )
242242
243- assert .Equal ("TibiaData-API/v4 (release/unknown; build/manual; commit/-; edition/open-source; unittest.example.com)" , TibiaDataUserAgentGenerator (TibiaDataAPIversion ))
244-
245243 healthz (c )
246244 assert .Equal (http .StatusOK , w .Code )
247245
You can’t perform that action at this time.
0 commit comments