package types

import "testing"

// NewUser returns a new User
func TestNewUser(t *testing.T) {
	u := User{
		UserId:   "123",
		Username: "test",
		Password: "password",
	}

	if u.UserId != "123" {
		t.Errorf("Expected user id to be 123, got %s", u.UserId)
	}
	if u.Username != "test" {
		t.Errorf("Expected username to be test, got %s", u.Username)
	}
	if u.Password != "password" {
		t.Errorf("Expected password to be password, got %s", u.Password)
	}
}

func TestToPublicUser(t *testing.T) {
	u := User{
		UserId:   "123",
		Username: "test",
		Password: "password",
	}

	_, err := u.ToPublicUser()
	if err != nil {
		t.Errorf("Expected no error, got %s", err)
	}
}
