-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock_borders_test.go
49 lines (36 loc) · 1.67 KB
/
block_borders_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
38
39
40
41
42
43
44
45
46
47
48
49
package pdflexgo
import (
"testing"
"github.com/kjk/flex"
"github.com/stretchr/testify/assert"
)
func TestBlockBorderWidth(t *testing.T) {
block := Block().
BorderWidth(5, 4, 3, 2)
assert.Equal(t, float32(5), block.getFlexNode().StyleGetBorder(flex.EdgeTop))
assert.Equal(t, float32(4), block.getFlexNode().StyleGetBorder(flex.EdgeRight))
assert.Equal(t, float32(3), block.getFlexNode().StyleGetBorder(flex.EdgeBottom))
assert.Equal(t, float32(2), block.getFlexNode().StyleGetBorder(flex.EdgeLeft))
block = Block().
BorderWidthTop(5).
BorderWidthRight(4).
BorderWidthBottom(3).
BorderWidthLeft(2)
assert.Equal(t, float32(5), block.getFlexNode().StyleGetBorder(flex.EdgeTop))
assert.Equal(t, float32(4), block.getFlexNode().StyleGetBorder(flex.EdgeRight))
assert.Equal(t, float32(3), block.getFlexNode().StyleGetBorder(flex.EdgeBottom))
assert.Equal(t, float32(2), block.getFlexNode().StyleGetBorder(flex.EdgeLeft))
block = Block().
BorderWidthVertical(7).
BorderWidthHorizontal(6)
assert.Equal(t, float32(7), block.getFlexNode().StyleGetBorder(flex.EdgeTop))
assert.Equal(t, float32(7), block.getFlexNode().StyleGetBorder(flex.EdgeBottom))
assert.Equal(t, float32(6), block.getFlexNode().StyleGetBorder(flex.EdgeRight))
assert.Equal(t, float32(6), block.getFlexNode().StyleGetBorder(flex.EdgeLeft))
block = Block().
BorderWidthAll(6)
assert.Equal(t, float32(6), block.getFlexNode().StyleGetBorder(flex.EdgeTop))
assert.Equal(t, float32(6), block.getFlexNode().StyleGetBorder(flex.EdgeRight))
assert.Equal(t, float32(6), block.getFlexNode().StyleGetBorder(flex.EdgeBottom))
assert.Equal(t, float32(6), block.getFlexNode().StyleGetBorder(flex.EdgeLeft))
}