unification of sample and test coding styles will improve visibility

* "Style{Show: true}" to "StyleShow()"
* "Box{IsSet: true}" to "BoxZero"
This commit is contained in:
x-qch 2017-12-30 04:28:56 +09:00
parent f72f7fd57b
commit a89a0bbfde
18 changed files with 44 additions and 96 deletions

View file

@ -8,7 +8,7 @@ import (
"testing"
"time"
"github.com/blendlabs/go-assert"
assert "github.com/blendlabs/go-assert"
"github.com/wcharczuk/go-chart/drawing"
"github.com/wcharczuk/go-chart/seq"
)
@ -278,27 +278,21 @@ func TestChartHasAxes(t *testing.T) {
x := Chart{
XAxis: XAxis{
Style: Style{
Show: true,
},
Style: StyleShow(),
},
}
assert.True(x.hasAxes())
y := Chart{
YAxis: YAxis{
Style: Style{
Show: true,
},
Style: StyleShow(),
},
}
assert.True(y.hasAxes())
ya := Chart{
YAxisSecondary: YAxis{
Style: Style{
Show: true,
},
Style: StyleShow(),
},
}
assert.True(ya.hasAxes())
@ -312,15 +306,15 @@ func TestChartGetAxesTicks(t *testing.T) {
c := Chart{
XAxis: XAxis{
Style: Style{Show: true},
Style: StyleShow(),
Range: &ContinuousRange{Min: 9.8, Max: 19.8},
},
YAxis: YAxis{
Style: Style{Show: true},
Style: StyleShow(),
Range: &ContinuousRange{Min: 9.9, Max: 19.9},
},
YAxisSecondary: YAxis{
Style: Style{Show: true},
Style: StyleShow(),
Range: &ContinuousRange{Min: 9.7, Max: 19.7},
},
}
@ -498,10 +492,10 @@ func TestChartE2ELine(t *testing.T) {
Height: 50,
Width: 50,
Canvas: Style{
Padding: Box{IsSet: true},
Padding: BoxZero,
},
Background: Style{
Padding: Box{IsSet: true},
Padding: BoxZero,
},
Series: []Series{
ContinuousSeries{
@ -538,10 +532,10 @@ func TestChartE2ELineWithFill(t *testing.T) {
Height: 50,
Width: 50,
Canvas: Style{
Padding: Box{IsSet: true},
Padding: BoxZero,
},
Background: Style{
Padding: Box{IsSet: true},
Padding: BoxZero,
},
Series: []Series{
ContinuousSeries{