Open dipankardas011 opened 1 year ago
Here is the test function for more context
func TestIsValidRegion(t *testing.T) {
testSet := map[string]error{
"LON1": nil,
"FRA1": nil,
"NYC1": nil,
"Lon!": errors.New(""),
"": errors.New(""),
}
for region, expected := range testSet {
// FIXME: want to use fakeClient but it uses real client
if err := isValidRegion(region); (expected != nil && err == nil) || (expected == nil && err != nil) {
t.Fatalf("Region code mismatch %s\n", region)
}
}
}
currently I am using the civogo client to get all the valid regions to validate users input.
now i want to test this function, via fakeCLient but it is returning
fake output [{FAKE1 Fake testing region false {false false false false false false false false false} true}]
regions. and using the original client requires creds