package com.axiastudio.zoefx.core.beans.property;

import com.axiastudio.zoefx.demo.Book;
import javafx.beans.property.Property;
import javafx.beans.property.SimpleStringProperty;
import org.junit.Test;

/**
 * User: tiziano
 * Date: 14/04/14
 * Time: 15:08
 */
public class ItemPropertyBuilderTest {


    /*class Book {
        String title;
        String description;
    }*/

    @Test
    public void test() throws Exception {

        Book book = new Book();
        book.title = "";

        Property titleProperty = ItemPropertyBuilder.create().bean(book).property("title").build();

        String aString="";
        SimpleStringProperty simpleStringProperty = new SimpleStringProperty(aString);

        titleProperty.bindBidirectional(simpleStringProperty);

        titleProperty.setValue("Anna Karenina");

        assert aString.equals(book.title);

    }
}

@@ -765,37 +765,44 @@
 erty);%0A%0A        
-title
+simpleString
 Property.setValu
@@ -801,13 +801,8 @@
 .set
-Value
 (%22An
@@ -836,33 +836,66 @@
 ert 
-aString.equals(book.title
+simpleStringProperty.get().equals(titleProperty.getValue()
 );%0A%0A

Test fix