<commit_before>package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.services.products.persistence;

import android.content.Context;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import org.junit.Before;
import org.junit.Test;
import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.services.products.persistence.entity.ProductEntity;
import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.services.products.persistence.impl.ProductDaoImpl;

import static org.junit.Assert.*;

/**
 * Description:
 * Author: <NAME>
 * Created: 16.05.16 18:33 creation date
 */
public class ProductDaoTest extends AndroidTestCase
{
    Context context;

    @Before
    public void setUp() throws Exception
    {
        context = new RenamingDelegatingContext(getContext(), "test_");

    }

    @Test
    public void save() throws Exception
    {
        String expectedName = "Product_Name";

        ProductDao productDao = new ProductDaoImpl();
        ProductEntity entity = new ProductEntity();
        entity.setId(1L);
        entity.setProductName(expectedName);
        Long id = productDao.save(context, entity);
        assertNotNull(id);

        ProductEntity entity2 = productDao.getById(context, id);
        assertEquals(expectedName, entity2.getProductName());
    }

}<commit_msg>bug fix name of test method (testSave).<commit_after>package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.services.products.persistence;

import android.content.Context;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import org.junit.Before;
import org.junit.Test;
import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.services.products.persistence.entity.ProductEntity;
import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.services.products.persistence.impl.ProductDaoImpl;

import static org.junit.Assert.*;

/**
 * Description:
 * Author: <NAME>
 * Created: 16.05.16 18:33 creation date
 */
public class ProductDaoTest extends AndroidTestCase
{
    Context context;

    @Before
    public void setUp() throws Exception
    {
        context = new RenamingDelegatingContext(getContext(), "test_");

    }

    @Test
    public void testSave() throws Exception
    {
        String expectedName = "Product_Name";

        ProductDao productDao = new ProductDaoImpl();
        ProductEntity entity = new ProductEntity();
        entity.setId(1L);
        entity.setProductName(expectedName);
        Long id = productDao.save(context, entity);
        assertNotNull(id);
    }

}
{'fraction_non_alphanumeric': 0.09255079006772009, 'fraction_numerical': 0.009029345372460496, 'mean_word_length': 4.234251968503937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1701432', 'n_tokens_mistral': 731, 'n_tokens_neox': 737, 'n_words': 148}