Пример #1
0
func (*facadeRegistrySuite) TestDescriptionFromVersions(c *gc.C) {
	facades := common.Versions{0: common.NilFacadeRecord}
	c.Check(common.DescriptionFromVersions("name", facades),
		gc.DeepEquals,
		common.FacadeDescription{
			Name:     "name",
			Versions: []int{0},
		})
	facades[2] = common.NilFacadeRecord
	c.Check(common.DescriptionFromVersions("name", facades),
		gc.DeepEquals,
		common.FacadeDescription{
			Name:     "name",
			Versions: []int{0, 2},
		})
}
Пример #2
0
func (*facadeRegistrySuite) TestDescriptionFromVersionsAreSorted(c *gc.C) {
	facades := common.Versions{
		10: common.NilFacadeRecord,
		5:  common.NilFacadeRecord,
		0:  common.NilFacadeRecord,
		18: common.NilFacadeRecord,
		6:  common.NilFacadeRecord,
		4:  common.NilFacadeRecord,
	}
	c.Check(common.DescriptionFromVersions("name", facades),
		gc.DeepEquals,
		common.FacadeDescription{
			Name:     "name",
			Versions: []int{0, 4, 5, 6, 10, 18},
		})
}