| Conditions | 4 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package config |
||
| 5 | func TestLocationIsSet(t *testing.T) { |
||
| 6 | cases := []struct { |
||
| 7 | name string |
||
| 8 | loc string |
||
| 9 | expect bool |
||
| 10 | }{ |
||
| 11 | { |
||
| 12 | name: "Location is set", |
||
| 13 | loc: "Russia/Moscow", |
||
| 14 | expect: true, |
||
| 15 | }, |
||
| 16 | { |
||
| 17 | name: "Location is not set", |
||
| 18 | loc: "", |
||
| 19 | expect: false, |
||
| 20 | }, |
||
| 21 | } |
||
| 22 | |||
| 23 | for _, tc := range cases { |
||
| 24 | t.Run(tc.name, func(t *testing.T) { |
||
| 25 | c := New("ru", tc.loc, []Translation{}) |
||
| 26 | actual := c.LocationIsSet() |
||
| 27 | |||
| 28 | if actual != tc.expect { |
||
| 29 | t.Fatalf("Expected %v, but got %v", tc.expect, actual) |
||
| 30 | } |
||
| 34 |