Skip to content

Commit

Permalink
Update Test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos committed Jul 5, 2018
1 parent 7cfdfeb commit c8d1169
Showing 1 changed file with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,41 @@ public void Version_UpdateAvailable_3() {
assertTrue(UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void Version_UpdateAvailable_4() {
Update installedUpdate = new Update();
installedUpdate.setLatestVersion("2.1.3.alpha.42.RC");

Update latestUpdate = new Update();
latestUpdate.setLatestVersion("2.1.3.alpha.45.RC");

assertTrue(UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void VersionCode_UpdateAvailable_1() {
Update installedUpdate = new Update("1.0.0", 1);
Update latestUpdate = new Update("1.0.0", 2);

assertTrue(UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void VersionCode_UpdateAvailable_2() {
Update installedUpdate = new Update("1.0.0", 1);
Update latestUpdate = new Update("1.0.1", 2);

assertTrue(UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void VersionCode_UpdateAvailable_3() {
Update installedUpdate = new Update("1.0.0", 1);
Update latestUpdate = new Update("0.9.0", 2);

assertTrue(UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void Version_UpdateNotAvailable_1() {
Update installedUpdate = new Update();
Expand All @@ -67,4 +102,28 @@ public void Version_UpdateNotAvailable_2() {
assertTrue(!UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void VersionCode_UpdateNotAvailable_1() {
Update installedUpdate = new Update("1.0.0", 1);
Update latestUpdate = new Update("1.0.0", 1);

assertTrue(!UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void VersionCode_UpdateNotAvailable_2() {
Update installedUpdate = new Update("1.0.0", 2);
Update latestUpdate = new Update("1.0.1", 1);

assertTrue(!UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

@Test
public void VersionCode_UpdateNotAvailable_3() {
Update installedUpdate = new Update("1.0.0", 1);
Update latestUpdate = new Update("1.2.0", 1);

assertTrue(!UtilsLibrary.isUpdateAvailable(installedUpdate, latestUpdate));
}

}

0 comments on commit c8d1169

Please sign in to comment.