Commit db577e31 authored by Boris Mühmer's avatar Boris Mühmer

added various dummy stuff

parent 012b9880
package management
package management
import "testing"
func TestDummy(t *testing.T) {
t.Skip("dummy test not implemented")
}
package player
// Player ...
type Player struct {
ID int
Name string
}
package player
import "testing"
func TestDummy(t *testing.T) {
t.Skip("dummy test not implemented")
}
package avatar
// Avatar ...
type Avatar struct {
ID int
Name string
}
package avatar
import "testing"
func TestDummy(t *testing.T) {
t.Skip("dummy test not implemented")
}
package item
// Item ...
type Item struct {
ID int
Name string
}
package item
import "testing"
func TestDummy(t *testing.T) {
t.Skip("dummy test not implemented")
}
package world
import (
"repositories.muehmer.net/bsmrgo/party/management/player"
"repositories.muehmer.net/bsmrgo/party/world/avatar"
"repositories.muehmer.net/bsmrgo/party/world/item"
"repositories.muehmer.net/bsmrgo/party/world/zone"
)
// World ...
type World struct {
Players [](*player.Player)
Avatars [](*avatar.Avatar)
Items [](*item.Item)
Zones [](*zone.Zone)
}
package world
import (
"testing"
"github.com/Pallinder/go-randomdata"
"repositories.muehmer.net/bsmrgo/party/management/player"
"repositories.muehmer.net/bsmrgo/party/world/avatar"
"repositories.muehmer.net/bsmrgo/party/world/item"
"repositories.muehmer.net/bsmrgo/party/world/zone"
)
func TestDummy(t *testing.T) {
t.Skip("dummy test not implemented")
}
func createDummyWorld(np, na, ni, nz int) *World {
ps := [](*player.Player){}
for i := 0; i < np; i++ {
p := &player.Player{
ID: i,
Name: randomdata.FullName(randomdata.RandomGender),
}
ps = append(ps, p)
}
as := [](*avatar.Avatar){}
for i := 0; i < na; i++ {
a := &avatar.Avatar{
ID: i,
Name: randomdata.FullName(randomdata.RandomGender),
}
as = append(as, a)
}
is := [](*item.Item){}
for i := 0; i < ni; i++ {
o := &item.Item{
ID: i,
Name: randomdata.SillyName(),
}
is = append(is, o)
}
zs := [](*zone.Zone){}
for i := 0; i < nz; i++ {
z := &zone.Zone{
ID: i,
Name: randomdata.State(randomdata.Small),
}
zs = append(zs, z)
}
return &World{
Players: ps,
Avatars: as,
Items: is,
Zones: zs,
}
}
func TestDummyWorld(t *testing.T) {
w := createDummyWorld(10, 10, 10, 10)
//t.Logf("dummy world: %#v", w)
for _, p := range w.Players {
t.Logf("player - ID %d - Name %q", p.ID, p.Name)
}
for _, a := range w.Avatars {
t.Logf("avatar - ID %d - Name %q", a.ID, a.Name)
}
for _, i := range w.Items {
t.Logf("item - ID %d - Name %q", i.ID, i.Name)
}
for _, z := range w.Zones {
t.Logf("zone - ID %d - Name %q", z.ID, z.Name)
}
}
package zone
// Zone ...
type Zone struct {
ID int
Name string
}
package zone
import "testing"
func TestDummy(t *testing.T) {
t.Skip("dummy test not implemented")
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment