Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
test: add test for creating customer firebase error
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Feb 11, 2020
1 parent e16fa2c commit 0d7dd11
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions firebase/error_test.go
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)
}
})
}
}

0 comments on commit 0d7dd11

Please sign in to comment.