Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/manuel-mauky/assertj-javafx

AssertJ assertions for JavaFX
https://github.com/manuel-mauky/assertj-javafx

assertj assertj-assertions javafx

Last synced: 2 months ago
JSON representation

AssertJ assertions for JavaFX

Awesome Lists containing this project

README

        

# AssertJ Assertions for JavaFX

[![Build Status](https://travis-ci.org/lestard/assertj-javafx.svg?branch=master)](https://travis-ci.org/lestard/assertj-javafx)

The goal of this project is to create AssertJ assertions for JavaFX (8).

## Example

```java

import javafx.beans.binding.Bindings;
import javafx.beans.binding.DoubleBinding;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import org.junit.Test;

import static eu.lestard.assertj.javafx.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.offset;

public class RadiusExample {

@Test
public void testCircleArea(){

DoubleProperty radius = new SimpleDoubleProperty();
DoubleBinding radiusSquared = radius.multiply(radius);

DoubleBinding circleArea = Bindings.multiply(Math.PI, radiusSquared);

radius.set(5);
assertThat(circleArea).hasValue(78.53, offset(0.01));

radius.set(12);
assertThat(circleArea).hasValue(452.4, offset(0.1));
}
}

```

## How to Use

Gradle:

```groovy
dependencies {
testCompile 'eu.lestard:assertj-javafx:0.3.0'
}
```

Maven:
```xml

eu.lestard
assertj-javafx
0.3.0
test

```

## Use the current development version

Snapshots of the current development version are available in the Sonatype OSS Snapshot repository.
They are created and deployed automatically by the Travis-CI on every commit.

Gradle:

```groovy
// add the sonatype snapshot repository
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}

dependencies {
testCompile 'eu.lestard:assertj-javafx:0.4.0-SNAPSHOT'
}

```

## Links
[JavaDoc](https://lestard.github.io/assertj-javafx/javadoc/0.3.0/)