github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/worker/credentialvalidator/validate_test.go (about) 1 // Copyright 2018 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package credentialvalidator_test 5 6 import ( 7 "github.com/juju/testing" 8 jc "github.com/juju/testing/checkers" 9 gc "gopkg.in/check.v1" 10 ) 11 12 type ValidateSuite struct { 13 testing.IsolationSuite 14 } 15 16 var _ = gc.Suite(&ValidateSuite{}) 17 18 func (*ValidateSuite) TestValid(c *gc.C) { 19 config := validConfig() 20 err := config.Validate() 21 c.Check(err, jc.ErrorIsNil) 22 } 23 24 func (*ValidateSuite) TestNilFacade(c *gc.C) { 25 config := validConfig() 26 config.Facade = nil 27 checkNotValid(c, config, "nil Facade not valid") 28 }