Esempio n. 1
0
func (s *MarshallerSuite) TestMarshalEmptySets(c *gocheck.C) {
	testObj := testObjectWithEmptySets()
	attrs, err := dynamodb.MarshalAttributes(testObj)
	if err != nil {
		c.Errorf("Error from dynamodb.MarshalAttributes: %#v", err)
	}

	expected := testAttrsWithNilSets()
	c.Check(attrs, gocheck.DeepEquals, expected)
}
Esempio n. 2
0
func (s *MarshallerSuite) TestMarshalTime(c *check.C) {
	testObj := testObjectTime()
	attrs, err := dynamodb.MarshalAttributes(testObj)
	if err != nil {
		c.Errorf("Error from dynamodb.MarshalAttributes: %#v", err)
	}

	expected := testAttrsTime()
	c.Check(attrs, check.DeepEquals, expected)
}
Esempio n. 3
0
func TestMarshalEmptySets(t *testing.T) {
	testObj := testObjectWithEmptySets()
	attrs, err := dynamodb.MarshalAttributes(testObj)
	if err != nil {
		t.Errorf("Error from dynamodb.MarshalAttributes: %#v", err)
	}

	expected := testAttrsWithNilSets()
	if fmt.Sprintf("%#v", expected) != fmt.Sprintf("%#v", attrs) {
		t.Errorf("Unexpected result for Marshal: was: `%s` but expected: `%s`", fmt.Sprintf("%#v", attrs), fmt.Sprintf("%#v", expected))
	}
}