package start;

import moduls.Item;
import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;



/**
 * Created by ${Ruslan} on 20.09.16.
 */
public class TrackerTest {
    Tracker tracker = new Tracker();

    @Test
    public void testAddClient() throws Exception {
        Item item = new Item("Ron", 123, "repair iron");
        assertThat(tracker.addClient(item), is(item));
    }

    @Test
    public void testFindById() throws Exception {

    }

    @Test
    public void testGetAll() throws Exception {
        Item []itemstest = new Item[3];
        itemstest[0] = new Item("Roma", 123, "repair irons");
        itemstest[1] = new Item("Ron", 12, "repair iron");
        itemstest[2] = new Item("Atilla", 13, "repair hairdryer");
        for (Item itemtest:
             itemstest) {
            tracker.addClient(itemtest);
        }
        assertArrayEquals(tracker.getAll(), itemstest);


    }
}
@@ -479,17 +479,753 @@
 ption %7B%0A
+        /*Item testClient = new Item(%22Ron%22, 123, %22repair iron%22);%0A        String testClientId = tracker.addClient(testClient).getClientId();%0A        assertThat(tracker.findById(testClientId), is(testClient));*/%0A        Item %5B%5Ditemstest = new Item%5B3%5D;%0A        itemstest%5B0%5D = new Item(%22Roma%22, 123, %22repair irons%22);%0A        itemstest%5B1%5D = new Item(%22Ron%22, 12, %22repair iron%22);%0A        itemstest%5B2%5D = new Item(%22Atilla%22, 13, %22repair hairdryer%22);%0A        String %5B%5DtestClientIds = new String%5B3%5D;%0A        int i = 0;%0A        for (Item itemtest:%0A                itemstest) %7B%0A            testClientIds%5Bi%5D = tracker.addClient(itemtest).getClientId();%0A            i++;%0A        %7D%0A        assertThat(tracker.findById(testClientIds%5B2%5D), is(itemstest%5B2%5D));
 %0A
-
     %7D%0A%0A 
@@ -1606,32 +1606,32 @@
 est);%0A        %7D%0A
+
         assertAr
@@ -1670,17 +1670,15 @@
 stest);%0A
-%0A%0A
     %7D%0A%7D

test getall done