2
Copyright 2013-2014 Canonical Ltd.
4
This program is free software: you can redistribute it and/or modify it
5
under the terms of the GNU General Public License version 3, as published
6
by the Free Software Foundation.
8
This program is distributed in the hope that it will be useful, but
9
WITHOUT ANY WARRANTY; without even the implied warranties of
10
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along
14
with this program. If not, see <http://www.gnu.org/licenses/>.
21
. "launchpad.net/gocheck"
26
func Test(t *testing.T) { TestingT(t) }
28
type IdentifierSuite struct{}
30
var _ = Suite(&IdentifierSuite{})
32
// TestSettableDefaultValueVisible tests that SettableIdentifier's default
34
func (s *IdentifierSuite) TestSettableDefaultValueVisible(c *C) {
36
c.Check(id.String(), Equals, "<Settable>")
39
// TestSettableSets tests that SettableIdentifier is settable.
40
func (s *IdentifierSuite) TestSettableSets(c *C) {
43
c.Check(id.String(), Equals, "hello")
46
// TestSettableGenerateDoesNotFail tests that SettableIdentifier's Generate
48
func (s *IdentifierSuite) TestSettableGenerateDoesNotFail(c *C) {
50
c.Check(id.Generate(), Equals, nil)
53
// TestFailingFails tests that FailingIdentifier fails.
54
func (s *IdentifierSuite) TestFailingFails(c *C) {
56
c.Check(id.Generate(), Not(Equals), nil)
59
// TestFailingStringNotEmpty tests that FailingIdentifier still has a
61
func (s *IdentifierSuite) TestFailingStringNotEmpty(c *C) {
63
c.Check(id.String(), Equals, "<Failing>")
66
// TestIdentifierInterface tests that FailingIdentifier and
67
// SettableIdentifier implement Id.
68
func (s *IdentifierSuite) TestIdentifierInterface(c *C) {
69
_ = []identifier.Id{Failing(), Settable()}