Skip to content

Instantly share code, notes, and snippets.

@arindamroynitw
Created August 26, 2019 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arindamroynitw/5a8c9111f4f50718f0c3e887d59c576c to your computer and use it in GitHub Desktop.
Save arindamroynitw/5a8c9111f4f50718f0c3e887d59c576c to your computer and use it in GitHub Desktop.
import (
"testing"
)
func Test_keyOp_Generate(t *testing.T) {
type args struct {
x int
y int
}
tests := []struct {
name string
args args
want string
}{
{
name: "success",
args: args{
x: 5,
y: 50,
},
want: "5_50",
},
{
name: "success large integers",
args: args{
x: 50000,
y: 999999,
},
want: "50000_999999",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
kp := GetKeyOperator()
if got := kp.Generate(tt.args.x, tt.args.y); got != tt.want {
t.Errorf("keyOp.Generate() = %v, want %v", got, tt.want)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment