File tree Expand file tree Collapse file tree 2 files changed +42
-7
lines changed
src/test/kotlin/dev/shtanko/truth Expand file tree Collapse file tree 2 files changed +42
-7
lines changed Original file line number Diff line number Diff line change 22
22
23
23
### Metrics
24
24
``` text
25
- 15050 number of properties
26
- 10451 number of functions
27
- 8905 number of classes
25
+ 15055 number of properties
26
+ 10456 number of functions
27
+ 8907 number of classes
28
28
235 number of packages
29
29
3514 number of kt files
30
30
```
31
31
32
32
33
33
### Complexity Report
34
34
``` text
35
- 265695 lines of code (loc)
36
- 164962 source lines of code (sloc)
37
- 120475 logical lines of code (lloc)
35
+ 265730 lines of code (loc)
36
+ 164992 source lines of code (sloc)
37
+ 120498 logical lines of code (lloc)
38
38
72531 comment lines of code (cloc)
39
- 24870 cyclomatic complexity (mcc)
39
+ 24875 cyclomatic complexity (mcc)
40
40
20331 cognitive complexity
41
41
0 number of total code smells
42
42
43 comment source ratio
Original file line number Diff line number Diff line change @@ -25,4 +25,39 @@ class TruthExampleTest {
25
25
val result = 2 + 2
26
26
assertThat(result).isEqualTo(4 )
27
27
}
28
+
29
+ @Test
30
+ fun testStrings () {
31
+ val message = " Hello, Truth!"
32
+ assertThat(message).contains(" Truth" )
33
+ }
34
+ }
35
+
36
+ class CollectionTruthTest {
37
+ @Test
38
+ fun testListContents () {
39
+ val fruits = listOf (" apple" , " banana" , " orange" )
40
+ assertThat(fruits).containsExactly(" banana" , " orange" , " apple" )
41
+ }
42
+
43
+ @Test
44
+ fun testMapContents () {
45
+ val map = mapOf (" kotlin" to 2.2 , " java" to 21 )
46
+ assertThat(map).containsEntry(" kotlin" , 2.2 )
47
+ assertThat(map).doesNotContainKey(" scala" )
48
+ }
49
+ }
50
+
51
+ class NullableTruthTest {
52
+ @Test
53
+ fun testNullValues () {
54
+ val name: String? = null
55
+ assertThat(name).isNull()
56
+ }
57
+
58
+ @Test
59
+ fun testNonNull () {
60
+ val language: String? = " Kotlin"
61
+ assertThat(language).isNotNull()
62
+ }
28
63
}
You can’t perform that action at this time.
0 commit comments