2013-10-28 17:23:33 -04:00
|
|
|
package namesgenerator
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2013-11-24 19:25:15 -05:00
|
|
|
// Make sure the generated names are awesome
|
|
|
|
func TestGenerateAwesomeNames(t *testing.T) {
|
2014-05-23 20:51:16 -04:00
|
|
|
name := GetRandomName(0)
|
2013-11-24 19:25:15 -05:00
|
|
|
if !isAwesome(name) {
|
|
|
|
t.Fatalf("Generated name '%s' is not awesome.", name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// To be awesome, a container name must involve cool inventors, be easy to remember,
|
|
|
|
// be at least mildly funny, and always be politically correct for enterprise adoption.
|
|
|
|
func isAwesome(name string) bool {
|
|
|
|
coolInventorNames := true
|
|
|
|
easyToRemember := true
|
|
|
|
mildlyFunnyOnOccasion := true
|
|
|
|
politicallyCorrect := true
|
|
|
|
return coolInventorNames && easyToRemember && mildlyFunnyOnOccasion && politicallyCorrect
|
|
|
|
}
|