Skip to content

Commit

Permalink
format utils test refactor (#285)
Browse files Browse the repository at this point in the history
* format utils test refactor
* share text test refactor
  • Loading branch information
adammasyk authored Mar 24, 2020
1 parent c343002 commit d390ee1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ class FormatUtilsSharedTextTest {

@Test
fun getShareTextForGetTransaction() {
Truth.assertThat(
FormatUtils.getShareText(contextMock, TestTransactionFactory.createTransaction("GET"), false)
)
.isEqualTo(TestTransactionFactory.expectedGetHttpTransaction)
val shareText = getShareText("GET")
Truth.assertThat(shareText).isEqualTo(TestTransactionFactory.expectedGetHttpTransaction)
}

@Test
fun getShareTextForPostTransaction() {
Truth.assertThat(
FormatUtils.getShareText(contextMock, TestTransactionFactory.createTransaction("POST"), false)
val shareText = getShareText("POST")
Truth.assertThat(shareText).isEqualTo(TestTransactionFactory.expectedHttpPostTransaction)
}

private fun getShareText(method: String): String {
return FormatUtils.getShareText(
contextMock,
TestTransactionFactory.createTransaction(method),
false
)
.isEqualTo(TestTransactionFactory.expectedHttpPostTransaction)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ class FormatUtilsTest {
}

@Test
fun formatXml_emptyString() {
fun testFormatXml_emptyString() {
assertThat(FormatUtils.formatXml("")).isEmpty()
}

@Test
fun formatXml_properXml() {
fun testFormatXml_properXml() {
val xml =
"""
<example>value</example>
Expand Down

0 comments on commit d390ee1

Please sign in to comment.