# Testing

{% code title="Example" overflow="wrap" %}

```java
new ResultChecker("testMethod")
                // .expect(A boolean value to be true, what it is testing);
                .expect(sucess, "Somthing to be true")
                .expect(value == 2, "value == 2");
```

{% endcode %}

{% code title="Real Example" overflow="wrap" %}

```java
new ResultChecker("testConnection")
                .expect(database.isConnected(), "database.isConnected()");
```

{% endcode %}

{% code title="Example" overflow="wrap" %}

```java
new ResultChecker("testMethod")
                // You can also do it like this. 
                // It will check if the values are equal.
                .expect(value, 2, "value == 2");
```

{% endcode %}

### Send a message when any expect fails

```java
new ResultChecker("testMethod")
                // If a boolean fails it will send this first.
                .fallBack("This test failed")
                .expect(sucess, "Somthing to be true")
                .expect(value == 2, "value == 2");
```

### Do something after

```java
new ResultChecker("testMethod")
                .expect(sucess, "Somthing to be true")
                .expect(value == 2, "value == 2")
                .then(() => aMethod());
```

You can just write code after a result checker tho.
