Esempio n. 1
0
func TestSave(t *testing.T) {

	var dv datastruct.DataValue
	var p person.Person
	p.Firstname = "test-firstname"
	p.Lastname = "test-lastname"
	p.Title = "test-title"
	p.Age = 42
	dv.Data = p
	gs := NewGobstore("person")
	err := gs.Save(dv)
	assert.Equal(t, err, nil, " there should be no error when saving, i.e. nil")

}
Esempio n. 2
0
func TestMultiSave(t *testing.T) {
	for x := 0; x < maxPeople; x++ {
		var dv datastruct.DataValue
		var p person.Person
		strX := strconv.Itoa(x)
		p.Firstname = "test-firstname" + strX
		p.Lastname = "test-lastname" + strX
		p.Title = "test-title" + strX
		p.Age = x
		dv.Data = p
		g := NewGobstore("person" + strX)
		err := g.Save(dv)
		assert.Equal(t, err, nil, " there should be no error when saving, i.e. nil")
	}
}