Esempio n. 1
0
// Client should return ErrStatusNotFound if trying to delete an Id that doesn't exist
func (s *TestSuite) TestDeleteNotFound(c *C) {
	// given
	locClient := client.LocationClient{Host: s.host}

	// when
	err := locClient.DeleteLocation(1)

	// then
	c.Assert(err, Equals, rest.ErrStatusNotFound)
}
Esempio n. 2
0
// Delete should Delete a location
func (s *TestSuite) TestDelete(c *C) {
	// given
	locClient := client.LocationClient{Host: s.host}

	location, _ := locClient.AddLocation("Austin", "Texas")

	// when
	err := locClient.DeleteLocation(location.Id)

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

	foundLocations, _ := locClient.FindAllLocations()

	c.Assert(len(foundLocations), Equals, 0)
}