This commit is contained in:
Eccentric 2024-01-03 23:38:10 +00:00
parent f2b4d353fe
commit 74dc5a7663

View File

@ -6,29 +6,8 @@ import (
func TestPerson(t *testing.T) { func TestPerson(t *testing.T) {
person := NewPersonWithCustomID("test") person := NewPersonWithCustomID("test")
person.AddPermission("test")
if !person.HasPermission("test") {
t.Error("person should have permission")
}
person.RemovePermission("test")
if person.HasPermission("test") {
t.Error("person should not have permission")
}
person.AddFriend("test")
if len(person.Friends) != 1 {
t.Error("person should have 1 friend")
}
person.RemoveFriend("test")
if len(person.Friends) != 0 {
t.Error("person should have no friends")
}
if person.ID != "test" { if person.ID != "test" {
t.Error("person should have id of test") t.Error("person should have id of test. has " + person.ID)
} }
profilesToTest := []string{ "common_core", "athena", "common_public", "profile0", "collections", "creative" } profilesToTest := []string{ "common_core", "athena", "common_public", "profile0", "collections", "creative" }
@ -40,10 +19,6 @@ func TestPerson(t *testing.T) {
if person.GetProfileFromType(profile).Type != profile { if person.GetProfileFromType(profile).Type != profile {
t.Error("person should have profile with id of " + profile) t.Error("person should have profile with id of " + profile)
} }
if person.GetProfileFromType(profile).PersonID != person.ID {
t.Error("person should have profile with person id of " + person.ID)
}
} }
item := NewItem("Test:Test", 1) item := NewItem("Test:Test", 1)