package com.sharparam.sharpmemory.helpers;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * Tests for {@link com.sharparam.sharpmemory.helpers.BrickHelper}.
 *
 * Created on 2014-04-04.
 *
 * @author Sharparam
 */
@RunWith(JUnit4.class)
public class BrickHelperTest {
    @Test
    public void testGetImage() throws Exception {

    }

    @Test
    public void testCreateImageView() throws Exception {

    }
}

@@ -37,16 +37,200 @@
 lpers;%0A%0A
+import com.sharparam.sharpmemory.tests.rules.JavaFXThreadingRule;%0Aimport javafx.scene.image.Image;%0Aimport javafx.scene.image.ImageView;%0Aimport org.junit.Assert;%0Aimport org.junit.Rule;%0A
 import o
@@ -503,138 +503,1365 @@
    @
-Test%0A    public void testGetImage() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testCreateImageView() throws Exception %7B%0A
+Rule%0A    public JavaFXThreadingRule javaFXThreadingRule = new JavaFXThreadingRule();%0A%0A    private static final String TEST_IMAGE_SOURCE = %22http://placehold.it/1x1%22;%0A%0A    @Test%0A    public void testGetImage() throws Exception %7B%0A        Image firstImage = BrickHelper.getImage(TEST_IMAGE_SOURCE);%0A        Image secondImage = BrickHelper.getImage(TEST_IMAGE_SOURCE);%0A        Assert.assertEquals(%22BrickHelper should return cached image on second request%22, firstImage, secondImage);%0A        Image forced = BrickHelper.getImage(TEST_IMAGE_SOURCE, true);%0A        Assert.assertNotSame(%22BrickHelper should return new image when forced=true%22, firstImage, forced);%0A    %7D%0A%0A    @Test%0A    public void testCreateImageView() throws Exception %7B%0A        Image image = BrickHelper.getImage(TEST_IMAGE_SOURCE);%0A        Image forced = BrickHelper.getImage(TEST_IMAGE_SOURCE, true);%0A%0A        ImageView view = BrickHelper.createImageView(image);%0A        Assert.assertEquals(%22ImageView requested with image object should have that image%22, image, view.getImage());%0A%0A        ImageView forcedView = BrickHelper.createImageView(TEST_IMAGE_SOURCE);%0A        Assert.assertEquals(%22ImageView requested with source should have latest cached image%22, forced, forcedView.getImage());%0A%0A        Assert.assertNotSame(%22ImageViews with different Image objects should not be equal%22, view, forcedView);
 %0A   

Implement tests for BrickHelper