coverage at 65.4%
This commit is contained in:
parent
bff8e074fd
commit
020ec8f4a4
1 changed files with 36 additions and 0 deletions
|
@ -47,3 +47,39 @@ func TestYAxisGetTicksWithUserDefaults(t *testing.T) {
|
||||||
ticks := ya.GetTicks(r, yr, styleDefaults, vf)
|
ticks := ya.GetTicks(r, yr, styleDefaults, vf)
|
||||||
assert.Len(ticks, 1)
|
assert.Len(ticks, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestYAxisMeasure(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
f, err := GetDefaultFont()
|
||||||
|
assert.Nil(err)
|
||||||
|
style := Style{
|
||||||
|
Font: f,
|
||||||
|
FontSize: 10.0,
|
||||||
|
}
|
||||||
|
r, err := PNG(100, 100)
|
||||||
|
assert.Nil(err)
|
||||||
|
ticks := []Tick{{Value: 1.0, Label: "1.0"}, {Value: 2.0, Label: "2.0"}, {Value: 3.0, Label: "3.0"}}
|
||||||
|
ya := YAxis{}
|
||||||
|
yab := ya.Measure(r, Box{0, 0, 100, 100}, &ContinuousRange{Min: 1.0, Max: 3.0, Domain: 100}, style, ticks)
|
||||||
|
assert.Equal(32, yab.Width())
|
||||||
|
assert.Equal(110, yab.Height())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestYAxisSecondaryMeasure(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
f, err := GetDefaultFont()
|
||||||
|
assert.Nil(err)
|
||||||
|
style := Style{
|
||||||
|
Font: f,
|
||||||
|
FontSize: 10.0,
|
||||||
|
}
|
||||||
|
r, err := PNG(100, 100)
|
||||||
|
assert.Nil(err)
|
||||||
|
ticks := []Tick{{Value: 1.0, Label: "1.0"}, {Value: 2.0, Label: "2.0"}, {Value: 3.0, Label: "3.0"}}
|
||||||
|
ya := YAxis{AxisType: YAxisSecondary}
|
||||||
|
yab := ya.Measure(r, Box{0, 0, 100, 100}, &ContinuousRange{Min: 1.0, Max: 3.0, Domain: 100}, style, ticks)
|
||||||
|
assert.Equal(32, yab.Width())
|
||||||
|
assert.Equal(110, yab.Height())
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue