-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add
EmailAddress.Companion.qualifiedName
property (#635)
- Loading branch information
Showing
8 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ry/src/jvmAndNativeTest/kotlin/org/kotools/types/EmailAddressCompanionJvmAndNativeTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.kotools.types | ||
|
||
import kotools.types.experimental.ExperimentalKotoolsTypesApi | ||
import kotools.types.internal.simpleNameOf | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
@OptIn(ExperimentalKotoolsTypesApi::class) | ||
class EmailAddressCompanionJvmAndNativeTest { | ||
@Test | ||
fun `qualifiedName should return the qualified name of EmailAddress`() { | ||
val actual: String = EmailAddress.qualifiedName | ||
val expected: String = checkNotNull(EmailAddress::class.qualifiedName) { | ||
val emailAddressSimpleName: String = simpleNameOf<EmailAddress>() | ||
"Getting qualified name of '$emailAddressSimpleName' shouldn't " + | ||
"return null." | ||
} | ||
assertEquals(expected, actual) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ void patternSample() { | |
System.out.println(pattern); // ^\S+@\S+\.\S+$ | ||
} // END | ||
|
||
void qualifiedName() { | ||
final String qualifiedName = EmailAddress.qualifiedName(); | ||
System.out.println(qualifiedName); // org.kotools.types.EmailAddress | ||
} // END | ||
|
||
void fromString_Any() { | ||
final Object value = "[email protected]"; | ||
try { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,11 @@ internal object EmailAddressCompanionKotlinSample { | |
println(pattern) // ^\S+@\S+\.\S+$ | ||
} // END | ||
|
||
fun qualifiedName() { | ||
val qualifiedName: String = EmailAddress.qualifiedName | ||
println(qualifiedName) // org.kotools.types.EmailAddress | ||
} // END | ||
|
||
@Suppress("FunctionName") | ||
fun fromString_Any() { | ||
val value: Any = "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters