31 lines
575 B
Go
31 lines
575 B
Go
|
package error
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestEntityValidationFailed_Error(t *testing.T) {
|
||
|
type fields struct {
|
||
|
Reason string
|
||
|
}
|
||
|
tests := []struct {
|
||
|
name string
|
||
|
fields fields
|
||
|
want string
|
||
|
}{
|
||
|
{
|
||
|
name: "Test 1: Reason",
|
||
|
fields: fields{Reason: "TEST ERROR"},
|
||
|
want: "Entity validation failed: TEST ERROR",
|
||
|
},
|
||
|
}
|
||
|
for _, tt := range tests {
|
||
|
t.Run(tt.name, func(t *testing.T) {
|
||
|
e := EntityValidationFailed{
|
||
|
Reason: tt.fields.Reason,
|
||
|
}
|
||
|
if got := e.Error(); got != tt.want {
|
||
|
t.Errorf("Error() = %v, want %v", got, tt.want)
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|