Пример #1
0
func TestRiemannConfShouldDefault(t *testing.T) {
	assert := assert.New(t)

	rc := riemann.RiemannConf{}

	rc.Default()

	assert.Equal("localhost", rc.Host)
	assert.Equal(uint(5555), rc.Port)

}
Пример #2
0
func TestRiemannConfShouldValidate(t *testing.T) {
	assert := assert.New(t)

	rc := riemann.RiemannConf{
		Host: "example.com",
		Port: 42,
	}

	err := rc.Validate()
	assert.Nil(err)

	assert.Equal("example.com", rc.Host)
	assert.Equal(uint(42), rc.Port)

}