forked from splitio/split-synchronizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
37 lines (32 loc) · 922 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"testing"
)
func TestWrongConfigs(t *testing.T) {
c := "test/dataset/test.conf.error1.json"
err := loadConfiguration(&c, nil)
if err.Error() != "\"redisError\" is not a valid property in configuration" {
t.Error("Unexpected error msg")
}
}
func TestWrongConfigsChild(t *testing.T) {
c := "test/dataset/test.conf.error2.json"
err := loadConfiguration(&c, nil)
if err.Error() != "\"redis.hostError\" is not a valid property in configuration" {
t.Error("Unexpected error msg")
}
}
func TestWrongConfigsMetric(t *testing.T) {
c := "test/dataset/test.conf.error3.json"
err := loadConfiguration(&c, nil)
if err.Error() != "\"metricsError\" is not a valid property in configuration" {
t.Error("Unexpected error msg")
}
}
func TestConfigsOk(t *testing.T) {
c := "test/dataset/test.conf.json"
err := loadConfiguration(&c, nil)
if err != nil {
t.Error("Unexpected error msg")
}
}