<commit_before>package io.explod.testable.data.local;

import android.annotation.SuppressLint;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;

import java.util.concurrent.atomic.AtomicInteger;

import io.reactivex.Observable;
import meta.BaseRoboTest;
import meta.rx.ImmediateSchedulerRule;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;

@SuppressLint("DefaultLocale")
@RunWith(RobolectricTestRunner.class)
public class AppLocalRepoTest extends BaseRoboTest {

	@Rule
	public ImmediateSchedulerRule rule = new ImmediateSchedulerRule();

	AppLocalRepo repo;

	@Before
	public void createRepo() {
		repo = new AppLocalRepo();
	}

	@Test
	public void insertAndGetGithubRepositories() throws Exception {
		AtomicInteger count = new AtomicInteger(0);

		repo
			.Users.insert("explodes")
			.flatMap(user -> repo.Repositories.insert(user.getId(), "test-repo1-" + user).map(x -> user))
			.flatMap(user -> repo.Repositories.insert(user.getId(), "test-repo2-" + user).map(x -> user))
			.flatMapObservable(user -> repo.Repositories.getAll())
			.subscribe(repo -> count.addAndGet(1), e -> fail(e.toString()));

		assertEquals(2, count.get());
	}

	@Test
	public void insertAndGetGithubUsers() throws Exception {
		AtomicInteger count = new AtomicInteger(0);

		Observable.merge(repo.Users.insert("abc").toObservable(), repo.Users.insert("123").toObservable()).subscribe(x -> {
		}, e -> fail(e.toString()));
		// subscribe in separate observable to make this test slightly different than the
		// equivalent github repository test
		repo.Users.getAll().subscribe(repo -> count.addAndGet(1), e -> fail(e.toString()));

		assertEquals(2, count.get());
	}

}<commit_msg>[test] remove tests for code that was wiped out during refactor<commit_after>package io.explod.testable.data.local;

import android.annotation.SuppressLint;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;

import meta.BaseRoboTest;
import meta.rx.ImmediateSchedulerRule;

@SuppressLint("DefaultLocale")
@RunWith(RobolectricTestRunner.class)
public class LocalRepoTest extends BaseRoboTest {

	@Rule
	public ImmediateSchedulerRule rule = new ImmediateSchedulerRule();

	LocalDatabase db;

	@Before
	public void createRepo() {
		db = new LocalDatabase(RuntimeEnvironment.application);
	}

	@After
	public void closeDatabase() {
		db.close();
	}

}
{'fraction_non_alphanumeric': 0.12284069097888675, 'fraction_numerical': 0.004222648752399232, 'mean_word_length': 5.402948402948403, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '3109378', 'n_tokens_mistral': 854, 'n_tokens_neox': 810, 'n_words': 173}