-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmobile_test.go
More file actions
49 lines (47 loc) · 757 Bytes
/
Copy pathmobile_test.go
File metadata and controls
49 lines (47 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package masker
import "testing"
func TestMobileMasker_Marshal(t *testing.T) {
type args struct {
s string
i string
}
tests := []struct {
name string
m *MobileMasker
args args
want string
}{
{
name: "Empty Input",
args: args{
s: "*",
i: "",
},
want: "",
},
{
name: "Happy Pass",
args: args{
s: "*",
i: "0978978978",
},
want: "0978***978",
},
{
name: "Happy Pass",
args: args{
s: "*",
i: "0912345678",
},
want: "0912***678",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
m := &MobileMasker{}
if got := m.Marshal(tt.args.s, tt.args.i); got != tt.want {
t.Errorf("MobileMasker.Marshal() = %v, want %v", got, tt.want)
}
})
}
}