Created
August 26, 2019 09:46
-
-
Save arindamroynitw/5a8c9111f4f50718f0c3e887d59c576c to your computer and use it in GitHub Desktop.
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
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