You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,28 @@
4
4
# AssertK - Fluent assertions for Kotlin
5
5
AssertK provides a Kotlin-friendly syntax for using the amazing AssertJ assertion framework.
6
6
7
-
This is early stages work and the library is not yet complete. Only a small subset of the AssertJ-core features are already implemented, but those that are, should be ready to be used in your projects. Contributions are welcome with regards to adding functionality to match that of AssertJ.
8
-
9
7
###Simple assertions
10
8
```kotlin
11
9
assert that Unit isEqualTo Unit
12
-
assert that Any() isNotEqualTo Any()
13
-
assert that Any() _is notNull
14
-
assert that nullObject _isnull
15
-
assert that anObject isInstance of<Any>()
16
-
assert that Any() describedAs "A labeled object" isInstance of<Unit>()
10
+
```
11
+
12
+
you can use `assert that` or `expect that` interchangeably as `assert` tends to be a bit noisy given when relying on autocomplete.
13
+
```kotlin
14
+
expect that Any() isNotEqualTo Any()
15
+
expect that Any() _is notNull
16
+
expect that nullObject _isnull
17
+
expect that anObject isInstance of<Any>()
18
+
expect that Any() describedAs "A labeled object" isInstance of<Unit>()
17
19
```
18
20
19
21
###Chained syntax
20
22
```kotlin
21
-
assert that Unit isNotEqualTo Any() isEqualTo Unit_is notNull isInstance of<Any>()
23
+
expect that Unit isNotEqualTo Any() isEqualTo Unit_is notNull isInstance of<Any>()
22
24
```
23
25
24
26
###Block syntax
25
27
```kotlin
26
-
assert that Any() isSuchThat {
28
+
expect that Any() isSuchThat {
27
29
it _is notNull
28
30
it isInstance of<Any>()
29
31
it isNotEqualTo Unit
@@ -34,12 +36,12 @@ assert that Any() isSuchThat {
0 commit comments