File tree 3 files changed +47
-0
lines changed
src/test/kotlin/com/cesarferreira/pluralize
3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ apply plugin: 'maven-publish'
15
15
16
16
dependencies {
17
17
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
18
+ testCompile ' junit:junit:4.13'
18
19
}
19
20
repositories {
20
21
mavenCentral()
Original file line number Diff line number Diff line change
1
+ package com.cesarferreira.pluralize
2
+
3
+ import org.junit.Assert.assertEquals
4
+ import org.junit.Test
5
+
6
+ class PluralizationTest {
7
+
8
+ @Test
9
+ fun `Should add default "s" suffix` () {
10
+ assertEquals(" posts" , " post" .pluralize())
11
+ }
12
+
13
+ @Test
14
+ fun `Should handle unCountable words` () {
15
+ assertEquals(" aircraft" , " aircraft" .pluralize())
16
+ }
17
+
18
+ @Test
19
+ fun `Should handle exception words` () {
20
+ assertEquals(" men" , " man" .pluralize())
21
+ }
22
+
23
+ }
Original file line number Diff line number Diff line change
1
+ package com.cesarferreira.pluralize
2
+
3
+ import org.junit.Assert.assertEquals
4
+ import org.junit.Test
5
+
6
+ class SingularizationTest {
7
+
8
+ @Test
9
+ fun `Should remove default "s" suffix` () {
10
+ assertEquals(" word" , " words" .singularize())
11
+ }
12
+
13
+ @Test
14
+ fun `Should handle unCountable words` () {
15
+ assertEquals(" scissors" , " scissors" .singularize())
16
+ }
17
+
18
+ @Test
19
+ fun `Should handle exception words` () {
20
+ assertEquals(" person" , " people" .singularize())
21
+ }
22
+
23
+ }
You can’t perform that action at this time.
0 commit comments