package uk.co.alexpringle.crate.test;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import uk.co.alexpringle.crate.test.crates.SimpleCrate;

@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class BasicTest
{
    private SimpleCrate testCrate;

    @Before
    public void setUp() throws Exception
    {
        TestHelper testHelper = new TestHelper();
        testHelper.clearCrateDatabase();
        testCrate = new SimpleCrate(RuntimeEnvironment.application);
    }

    @Test
    public void instantiateCrate()
    {
        SimpleCrate simpleCrate = new SimpleCrate(RuntimeEnvironment.application);
        Assert.assertNotNull(simpleCrate);
    }
}

@@ -324,16 +324,71 @@
 leCrate;
+%0Aimport uk.co.alexpringle.crate.test.crates.SimpleItem;
 %0A%0A@RunWi
@@ -476,16 +476,51 @@
 cTest%0A%7B%0A
+    private TestHelper testHelper;%0A
     priv
@@ -614,27 +614,16 @@
         
-TestHelper 
 testHelp
@@ -892,24 +892,24 @@
 plication);%0A
-
         Asse
@@ -944,11 +944,409 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void putItem()%0A    %7B%0A        SimpleItem randomItem = testHelper.createRandomSimpleItem();%0A        testCrate.put(randomItem);%0A%0A        SimpleItem retrievedItem = testCrate.withId(randomItem.getId());%0A        Assert.assertNotNull(retrievedItem);%0A        Assert.assertEquals(randomItem.getId(),retrievedItem.getId());%0A        Assert.assertEquals(randomItem,retrievedItem);%0A    %7D
 %0A%7D%0A

add putItem test