github.com/OrigamiWang/msd/micro@v0.0.0-20240229032328-b62246268db9/auth/crypto/md5_test.go (about)

     1  package crypto
     2  
     3  import "testing"
     4  
     5  func TestMd5Encode(t *testing.T) {
     6  	type args struct {
     7  		rawStr string
     8  	}
     9  	tests := []struct {
    10  		name string
    11  		args args
    12  		want string
    13  	}{
    14  		// TODO: Add test cases.
    15  		{
    16  			name: "test1",
    17  			args: args{rawStr: "abc123"},
    18  			want: "e99a18c428cb38d5f260853678922e03",
    19  		},
    20  	}
    21  	for _, tt := range tests {
    22  		t.Run(tt.name, func(t *testing.T) {
    23  			if got := Md5Encode(tt.args.rawStr); got != tt.want {
    24  				t.Errorf("Md5Encode() = %v, want %v", got, tt.want)
    25  			}
    26  		})
    27  	}
    28  }