Timothy J. Warren
787166df3a
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
36 lines
533 B
Go
36 lines
533 B
Go
package document
|
|
|
|
import "testing"
|
|
|
|
func TestNewDocument(t *testing.T) {
|
|
d := NewDocument()
|
|
|
|
if d == nil {
|
|
t.Errorf("Failed to create Document")
|
|
}
|
|
}
|
|
|
|
func TestAppendRow(t *testing.T) {
|
|
d := NewDocument()
|
|
d.AppendRow("Test Row")
|
|
|
|
got := len(d.rows)
|
|
want := 1
|
|
|
|
if got != want {
|
|
t.Errorf("Failed to add a row to the Document")
|
|
}
|
|
}
|
|
|
|
func TestRowCount(t *testing.T) {
|
|
d := NewDocument()
|
|
d.AppendRow("Test Row")
|
|
|
|
got := d.RowCount()
|
|
want := 1
|
|
|
|
if got != want {
|
|
t.Errorf("Expected %d rows, got %d rows", want, got)
|
|
}
|
|
}
|