func (*simplestreamsSuite) TestHasProductFindsMatchingProduct(c *gc.C) { metadata := simplestreams.IndexMetadata{ProductIds: []string{"x", "y", "z"}} c.Check( simplestreams.HasProduct(metadata, []string{"a", "b", metadata.ProductIds[1]}), gc.Equals, true) }
func (*simplestreamsSuite) TestHasProductReturnsFalseIfProductsDoNotMatch(c *gc.C) { metadata := simplestreams.IndexMetadata{ProductIds: []string{"x", "y", "z"}} c.Check(simplestreams.HasProduct(metadata, []string{"a", "b", "c"}), jc.IsFalse) }
func (*simplestreamsSuite) TestHasProductAcceptsNils(c *gc.C) { metadata := simplestreams.IndexMetadata{} c.Check(simplestreams.HasProduct(metadata, nil), jc.IsFalse) }