import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.ArrayList;

import org.junit.jupiter.api.Test;

public class OneTest
{
    @Test
    public void testPartA()
    {
        Account.notAvailable = new ArrayList<String>();
        Account.notAvailable.add("Luis-Cruz");
        Account.notAvailable.add("Luis-Cruz1");
        Account.notAvailable.add("Luis-Cruz2");

        Account a = new Account("Luis-Cruz");
        assertEquals("Luis-Cruz3", a.username);

        a = new Account("PSmith");
        assertEquals("PSmith", a.username);
    }

    @Test
    public void testPartBAgainstExamples()
    {
        Account a = new Account("Amy-Marie-Lin");
        assertEquals("AmMariLin", a.getShortenedName());

        a = new Account("SammyB3");
        assertEquals("SammyB3", a.getShortenedName());
    }

    @Test
    public void testPartBMore()
    {
        Account a = new Account("a-b");
        assertEquals("b", a.getShortenedName());

        a = new Account("a-b-c");
        assertEquals("c", a.getShortenedName());

        a = new Account("a");
        assertEquals("a", a.getShortenedName());
    }
}
