示例#1
0
文件: model.go 项目: Cristofori/kmud
func CreateZone(name string) (types.Zone, error) {
	if GetZoneByName(name) != nil {
		return nil, errors.New("A zone with that name already exists")
	}

	return db.NewZone(name), nil
}
示例#2
0
文件: dbtest.go 项目: Cristofori/kmud
func Test_Zone(t *testing.T) {
	zoneName := "testzone"
	zone := database.NewZone(zoneName)

	testutils.Assert(zone.GetName() == zoneName, t, "Zone didn't have correct name upon creation", zoneName, zone.GetName())
}