@Test public void versionCommitDescription_whenDirtyCommit_returnsCommitCountAndSHAAndDirtyTag() { MainMenuViewModel viewModel = createViewModelWithVersion("v1.14.0-181-ge51d004d4-dirty"); assertThat(viewModel.getVersionCommitDescription(), equalTo("181-ge51d004d4-dirty")); }
@Nullable public String getVersionCommitDescription() { String commitDescription = ""; if (version.getCommitCount() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitCount().toString()); } if (version.getCommitSHA() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitSHA()); } if (version.isDirty()) { commitDescription = appendToCommitDescription(commitDescription, "dirty"); } if (!commitDescription.isEmpty()) { return commitDescription; } else { return null; } }
MainMenuViewModel extends ViewModel { @Nullable public String getVersionCommitDescription() { String commitDescription = ""; if (version.getCommitCount() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitCount().toString()); } if (version.getCommitSHA() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitSHA()); } if (version.isDirty()) { commitDescription = appendToCommitDescription(commitDescription, "dirty"); } if (!commitDescription.isEmpty()) { return commitDescription; } else { return null; } } }
MainMenuViewModel extends ViewModel { @Nullable public String getVersionCommitDescription() { String commitDescription = ""; if (version.getCommitCount() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitCount().toString()); } if (version.getCommitSHA() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitSHA()); } if (version.isDirty()) { commitDescription = appendToCommitDescription(commitDescription, "dirty"); } if (!commitDescription.isEmpty()) { return commitDescription; } else { return null; } } MainMenuViewModel(Application application, VersionInformation versionInformation, PreferencesProvider preferencesProvider); }
MainMenuViewModel extends ViewModel { @Nullable public String getVersionCommitDescription() { String commitDescription = ""; if (version.getCommitCount() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitCount().toString()); } if (version.getCommitSHA() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitSHA()); } if (version.isDirty()) { commitDescription = appendToCommitDescription(commitDescription, "dirty"); } if (!commitDescription.isEmpty()) { return commitDescription; } else { return null; } } MainMenuViewModel(Application application, VersionInformation versionInformation, PreferencesProvider preferencesProvider); String getVersion(); @Nullable String getVersionCommitDescription(); boolean shouldEditSavedFormButtonBeVisible(); boolean shouldSendFinalizedFormButtonBeVisible(); boolean shouldViewSentFormButtonBeVisible(); boolean shouldGetBlankFormButtonBeVisible(); boolean shouldDeleteSavedFormButtonBeVisible(); }
MainMenuViewModel extends ViewModel { @Nullable public String getVersionCommitDescription() { String commitDescription = ""; if (version.getCommitCount() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitCount().toString()); } if (version.getCommitSHA() != null) { commitDescription = appendToCommitDescription(commitDescription, version.getCommitSHA()); } if (version.isDirty()) { commitDescription = appendToCommitDescription(commitDescription, "dirty"); } if (!commitDescription.isEmpty()) { return commitDescription; } else { return null; } } MainMenuViewModel(Application application, VersionInformation versionInformation, PreferencesProvider preferencesProvider); String getVersion(); @Nullable String getVersionCommitDescription(); boolean shouldEditSavedFormButtonBeVisible(); boolean shouldSendFinalizedFormButtonBeVisible(); boolean shouldViewSentFormButtonBeVisible(); boolean shouldGetBlankFormButtonBeVisible(); boolean shouldDeleteSavedFormButtonBeVisible();  }