Skip to content

Commit

Permalink
Merge "[GH] [Navigation] Fix tests in NavDeepLinkTest" into androidx-…
Browse files Browse the repository at this point in the history
…main
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Jul 28, 2021
2 parents 9c8233d + afa68d0 commit 2e9d375
Showing 1 changed file with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the argument and it should be null")
.that(matchArgs?.getString("myarg"))
.isNull()
assertWithMessage("Args should not contain the argument")
.that(matchArgs?.containsKey("myarg"))
.isFalse()
}

// Ensure case when matching the exact argument query (i.e. param names in braces) is handled
Expand Down Expand Up @@ -374,9 +374,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the argument and it should be null")
.that(matchArgs?.getString("myarg"))
.isNull()
assertWithMessage("Args should not contain the argument")
.that(matchArgs?.containsKey("myarg"))
.isFalse()
}

@Test
Expand Down Expand Up @@ -451,9 +451,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should contain the id")
.that(matchArgs?.getInt("id"))
.isEqualTo(id)
assertWithMessage("Args should contain optional")
.that(matchArgs?.getString("optional"))
.isNull()
assertWithMessage("Args should not contain optional")
.that(matchArgs?.containsKey("optional"))
.isFalse()
}

// Make sure we allow extra params that may not been part of the given deep link
Expand Down Expand Up @@ -541,9 +541,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the argument and it should be null")
.that(matchArgs?.getString("myarg"))
.isNull()
assertWithMessage("Args should not contain the argument")
.that(matchArgs?.containsKey("myarg"))
.isFalse()
}

@Test
Expand Down Expand Up @@ -579,9 +579,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the argument and it should be null")
.that(matchArgs?.getString("myarg"))
.isNull()
assertWithMessage("Args should not contain the argument")
.that(matchArgs?.containsKey("myarg"))
.isFalse()
}

@Test
Expand Down Expand Up @@ -632,9 +632,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the argument and it should be null")
.that(matchArgs?.getString("myarg"))
.isNull()
assertWithMessage("Args should not contain the argument")
.that(matchArgs?.containsKey("myarg"))
.isFalse()
}

@Test
Expand Down Expand Up @@ -745,12 +745,12 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the first name")
.that(matchArgs?.getString("first"))
.isNull()
assertWithMessage("Args should contain the last name")
.that(matchArgs?.getString("last"))
.isNull()
assertWithMessage("Args should not contain the first name")
.that(matchArgs?.containsKey("first"))
.isFalse()
assertWithMessage("Args should not contain the last name")
.that(matchArgs?.containsKey("last"))
.isFalse()
}

@Test
Expand Down Expand Up @@ -804,9 +804,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain arg as null")
.that(matchArgs?.getString("myarg"))
.isNull()
assertWithMessage("Args should not contain the argument")
.that(matchArgs?.containsKey("myarg"))
.isFalse()
}

// Handle the case were the input is wild card and separator with no argument
Expand Down Expand Up @@ -918,9 +918,9 @@ class NavDeepLinkTest {
assertWithMessage("Args should not be null")
.that(matchArgs)
.isNotNull()
assertWithMessage("Args should contain the path as null")
.that(matchArgs?.getString("path"))
.isNull()
assertWithMessage("Args should not contain the path")
.that(matchArgs?.containsKey("path"))
.isFalse()
}

// Handle the case were the input could be entire path except for the argument
Expand Down

0 comments on commit 2e9d375

Please sign in to comment.