Search in sources :

Example 6 with ItemRepoViewModel

use of uk.ivanc.archimvvm.viewmodel.ItemRepoViewModel in project archi by ivacf.

the class ItemRepoViewModelTest method shouldGetDescription.

@Test
public void shouldGetDescription() {
    Repository repository = new Repository();
    repository.description = "This is the description";
    ItemRepoViewModel itemRepoViewModel = new ItemRepoViewModel(application, repository);
    assertEquals(repository.description, itemRepoViewModel.getDescription());
}
Also used : Repository(uk.ivanc.archimvvm.model.Repository) ItemRepoViewModel(uk.ivanc.archimvvm.viewmodel.ItemRepoViewModel) Test(org.junit.Test)

Example 7 with ItemRepoViewModel

use of uk.ivanc.archimvvm.viewmodel.ItemRepoViewModel in project archi by ivacf.

the class ItemRepoViewModelTest method shouldGetForks.

@Test
public void shouldGetForks() {
    Repository repository = new Repository();
    repository.forks = 5;
    String expectedString = application.getString(R.string.text_forks, repository.forks);
    ItemRepoViewModel itemRepoViewModel = new ItemRepoViewModel(application, repository);
    assertEquals(expectedString, itemRepoViewModel.getForks());
}
Also used : Repository(uk.ivanc.archimvvm.model.Repository) ItemRepoViewModel(uk.ivanc.archimvvm.viewmodel.ItemRepoViewModel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 Repository (uk.ivanc.archimvvm.model.Repository)7 ItemRepoViewModel (uk.ivanc.archimvvm.viewmodel.ItemRepoViewModel)7 Context (android.content.Context)1 Intent (android.content.Intent)1 Observable (android.databinding.Observable)1 View (android.view.View)1