Adding a 'Typename' strongtype for representing all compute resource types.

This commit is contained in:
Vishnu Kannan
2015-01-17 00:34:47 +00:00
parent 4c413e794e
commit c32295a180
8 changed files with 146 additions and 0 deletions

View File

@@ -67,3 +67,21 @@ func TestSemantic(t *testing.T) {
}
}
}
func TestIsStandardResource(t *testing.T) {
testCases := []struct {
input string
output bool
}{
{"cpu", true},
{"memory", true},
{"disk", false},
{"blah", false},
{"x.y.z", false},
}
for i, tc := range testCases {
if IsStandardResourceName(tc.input) != tc.output {
t.Errorf("case[%d], expected: %t, got: %t", i, tc.output, !tc.output)
}
}
}