@@ -0,0 +1,2943 @@
+package edu.kit.informatik.bibliography.tests;%0A%0Aimport edu.kit.informatik.bibliography.Console;%0Aimport edu.kit.informatik.bibliography.TrackedEntity;%0Aimport edu.kit.informatik.Terminal;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Test;%0Aimport org.junit.Before;%0Aimport java.util.*;%0Aimport static edu.kit.informatik.bibliography.tests.TestHelper.*;%0A%0Apublic class CoauthorsTest%0A%7B%0A    @Before%0A    public void setUp()%0A    %7B%0A        TrackedEntity.reset();%0A    %7D%0A%0A%0A    @Test%0A    public void CoauthorsInvalidArgumentsTest()%0A    %7B%0A        String%5B%5D commands = new String%5B%5D%0A        %7B%0A            %22add author A,B%22,%0A            %22add author C,D%22,%0A            %22 coauthors of A B%22,%0A            %22coauthors of A,B%22,%0A            %22coauthors of A B %22,%0A            %22coauthors of A B,%22,%0A            %22coauthors of  A B%22,%0A            %22coauthors of A;B%22,%0A            %22coauthors of A  B%22,%0A            %22coauthors ofA B%22,%0A            %22coauthors ofaaaa A B%22,%0A            %22coauthors of A%22,%0A            %22coauthors of B%22,%0A            %22coauthors of B A%22,%0A            %22coauthors of A B,C D%22,%0A            %22coauthors of A B C D%22,%0A            %22coauthors of A B;C D%22,%0A            %22quit%22%0A        %7D;%0A%0A        Terminal.initialize(commands);%0A%0A        Console.main(null);%0A%0A        ArrayList%3CTerminal.Output%3E expected = new ArrayList%3C%3E();%0A        expected.add(Terminal.ok);%0A        expected.add(Terminal.ok);%0A        expected.addAll(Collections.nCopies(commands.length - 3, Terminal.error));%0A        expected.add(Terminal.ok);%0A%0A        assertArrayEquals(expected.toArray(), Terminal.getOutput());%0A        Terminal.finish();%0A    %7D%0A%0A    @Test%0A    public void CoauthorsValidArgumentsTest()%0A    %7B%0A        // FIXME: Add more things here once what names are allowed is well-defined.%0A        String%5B%5D commands = new String%5B%5D%0A        %7B%0A            %22add author A,B%22,%0A            %22add author C,D%22,%0A            %22add author E,F%22,%0A            %22add author G,H%22,%0A            %22add journal A,B%22,%0A            %22add article to journal A:a,2000,A%22,%0A            %22add article to journal A:b,2000,A%22,%0A            %22add article to journal A:c,2000,A%22,%0A            %22written-by a,A B;C D%22,%0A            %22written-by b,A B;C D;E F%22,%0A            %22written-by c,C D;E F%22,%0A            %22coauthors of A B%22,%0A            %22quit%22%0A        %7D;%0A%0A        Terminal.initialize(commands);%0A%0A        Console.main(null);%0A%0A        assertMiddleInAnyOrder(Collections.nCopies(11, Terminal.ok)%0A            .toArray(new Terminal.Output%5B0%5D),%0A            Terminal.strs(%22C D%22, %22E F%22), Terminal.strs(%22Ok%22), Terminal.getOutput());%0A        Terminal.finish();%0A    %7D%0A%0A    @Test%0A    public void CoauthorsAuthorMustExistTest()%0A    %7B%0A        Terminal.initialize(%0A            %22coauthors of A B%22,%0A            %22quit%22);%0A%0A        Console.main(null);%0A%0A        assertArrayEquals(new Terminal.Output%5B%5D%0A        %7B%0A            Terminal.error,%0A            Terminal.ok%0A        %7D, Terminal.getOutput());%0A        Terminal.finish();%0A    %7D%0A%7D%0A%0A// vim: set expandtab:%0A

Add CoauthorsTest