Exemplo n.º 1
0
// Client should return ErrStatusNotFound when not found
func (s *TestSuite) TestFindNotFound(c *C) {
	// given
	locClient := client.LocationClient{Host: s.host}

	// when
	_, err := locClient.FindLocation(1)

	// then
	c.Assert(err, Equals, rest.ErrStatusNotFound)
}
Exemplo n.º 2
0
// Location should be findable
func (s *TestSuite) TestFind(c *C) {
	// given
	locClient := client.LocationClient{Host: s.host}
	created, _ := locClient.AddLocation("Austin", "Texas")

	// when
	found, err := locClient.FindLocation(created.Id)

	// then
	c.Assert(err, Equals, nil)

	c.Assert(created, DeepEquals, found)
}