This repository has been archived by the owner on May 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for creating customer firebase error
- Loading branch information
1 parent
e16fa2c
commit 0d7dd11
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package firebase | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"testing" | ||
) | ||
|
||
func TestNewError(t *testing.T) { | ||
type args struct { | ||
err error | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want FirebaseError | ||
}{ | ||
{ | ||
"Test Error 1", | ||
args{ | ||
err: fmt.Errorf("ERROR"), | ||
}, | ||
FirebaseError{ | ||
FirebaseError: fmt.Errorf("ERROR"), | ||
}, | ||
}, | ||
{ | ||
"Test Error 2", | ||
args{ | ||
err: errors.New("ERROR"), | ||
}, | ||
FirebaseError{ | ||
FirebaseError: errors.New("ERROR"), | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := NewError(tt.args.err); got.Error() != tt.want.Error() { | ||
t.Errorf("NewError() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |