File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 2
2
AssertK provides a Kotlin-friendly syntax for using the amazing AssertJ assertion framework.
3
3
4
4
###Simple assertions
5
- ```
5
+ ``` kotlin
6
6
assert that Unit isEqualTo Unit
7
7
assert that Any () isNotEqualTo Any ()
8
8
assert that Any () _is notNull
@@ -12,12 +12,12 @@ assert that Any() describedAs "A labeled object" isInstance of<Unit>()
12
12
```
13
13
14
14
###Chained syntax
15
- ```
15
+ ``` kotlin
16
16
assert that Unit isNotEqualTo Any () isEqualTo Unit _is notNull isInstance of<Any >()
17
17
```
18
18
19
19
###Block syntax
20
- ```
20
+ ``` kotlin
21
21
assert that Any () isSuchThat {
22
22
it _is notNull
23
23
it isInstance of<Any >()
@@ -28,12 +28,12 @@ assert that Any() isSuchThat {
28
28
29
29
##Assertions on exceptions
30
30
###Chained syntax
31
- ```
31
+ ``` kotlin
32
32
assert thatExceptionIsThrownBy { failFunction() } hasMessageContaining " foo" hasCause Throwable ()
33
33
```
34
34
35
35
###Block syntax
36
- ```
36
+ ``` kotlin
37
37
assert thatExceptionIsThrownBy {
38
38
throw Throwable (" exception foo" , Throwable ())
39
39
} and {
@@ -47,7 +47,7 @@ assert thatExceptionIsThrownBy {
47
47
```
48
48
49
49
##Get it
50
- ```
50
+ ``` groovy
51
51
allprojects {
52
52
repositories {
53
53
...
You can’t perform that action at this time.
0 commit comments