(c *C)
| 42 | } |
| 43 | |
| 44 | func (s *MockClientSuite) TestAddMultiSimple(c *C) { |
| 45 | item1 := createTestItem() |
| 46 | item2 := createTestItem() |
| 47 | item2.Key = "foo" |
| 48 | items := []*Item{item1, item2} |
| 49 | |
| 50 | resps := s.client.AddMulti(items) |
| 51 | |
| 52 | c.Assert(resps, HasLen, 2) |
| 53 | for i := 0; i < 2; i++ { |
| 54 | item := items[i] |
| 55 | resp := resps[i] |
| 56 | |
| 57 | c.Assert(resp.Error(), IsNil) |
| 58 | c.Assert(resp.Key(), Equals, item.Key) |
| 59 | c.Assert(resp.DataVersionId(), Equals, uint64(1+i)) |
| 60 | |
| 61 | gresp := s.client.Get(item.Key) |
| 62 | c.Assert(gresp.Error(), IsNil) |
| 63 | c.Assert(bytes.Equal(gresp.Value(), item.Value), IsTrue) |
| 64 | c.Assert(gresp.DataVersionId(), Equals, uint64(1+i)) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | func (s *MockClientSuite) TestAddMultiEmpty(c *C) { |
| 69 | items := make([]*Item, 0) |
nothing calls this directly
no test coverage detected