Change method name.
This commit is contained in:
parent
a332c40530
commit
fa099f2ae2
2 changed files with 7 additions and 7 deletions
|
@ -41,8 +41,8 @@ func (o *Options) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasType returns if the options have the given type.
|
// Is returns if the options have the given type.
|
||||||
func (o *Options) HasType(t Type) bool {
|
func (o *Options) Is(t Type) bool {
|
||||||
if o == nil {
|
if o == nil {
|
||||||
return t.String() == SoftCAS
|
return t.String() == SoftCAS
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ func TestOptions_Validate(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOptions_HasType(t *testing.T) {
|
func TestOptions_Is(t *testing.T) {
|
||||||
mockRegister(t)
|
mockRegister(t)
|
||||||
|
|
||||||
type fields struct {
|
type fields struct {
|
||||||
|
@ -110,8 +110,8 @@ func TestOptions_HasType(t *testing.T) {
|
||||||
}
|
}
|
||||||
t.Run("nil", func(t *testing.T) {
|
t.Run("nil", func(t *testing.T) {
|
||||||
var o *Options
|
var o *Options
|
||||||
if got := o.HasType(SoftCAS); got != true {
|
if got := o.Is(SoftCAS); got != true {
|
||||||
t.Errorf("Options.HasType() = %v, want %v", got, true)
|
t.Errorf("Options.Is() = %v, want %v", got, true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
@ -123,8 +123,8 @@ func TestOptions_HasType(t *testing.T) {
|
||||||
Issuer: tt.fields.Issuer,
|
Issuer: tt.fields.Issuer,
|
||||||
Signer: tt.fields.Signer,
|
Signer: tt.fields.Signer,
|
||||||
}
|
}
|
||||||
if got := o.HasType(tt.args.t); got != tt.want {
|
if got := o.Is(tt.args.t); got != tt.want {
|
||||||
t.Errorf("Options.HasType() = %v, want %v", got, tt.want)
|
t.Errorf("Options.Is() = %v, want %v", got, tt.want)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue