Package booton.sample

Examples of booton.sample.Person


@RunWith(ScriptRunner.class)
public class ReadWriteTest {

    @Test
    public void bean() {
        Person person = I.make(Person.class);
        person.setAge(16);
        person.setName("Yuigahama Yui");

        Person other = writeThenRead(person);

        assert other.getAge() == 16;
        assert other.getName().equals("Yuigahama Yui");
    }
View Full Code Here


    @Test
    public void bind() throws Exception {
        Listener listener = I.make(Listener.class);

        Person person = new Person();
        person.setAge(16);
        person.setName("Yuigahama Yui");
        assert listener.age == 0;
        assert listener.name == null;

        listener.set(person);
        assert listener.age == 16;
        assert listener.name.equals("Yuigahama Yui");

        person.setAge(27);
        assert listener.age == 27;

        person.setName("Hiratuka Sizuka");
        assert listener.name.equals("Hiratuka Sizuka");
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void input() throws Exception {
        Person person = I.make(Person.class);

        BindableInput<Person> input = I.make(BindableInput.class);
        input.bind(person, "age");

        assert input.form.val().endsWith("0");

        person.setAge(16);
        assert input.form.val().equals("16");
    }
View Full Code Here

@RunWith(ScriptRunner.class)
public class KissTest {

    @Test
    public void make() throws Exception {
        Person person = I.make(Person.class);
        person.setAge(10);

        assert person.getAge() == 10;
    }
View Full Code Here

    @Test
    public void UserClass() {
        test(new Scriptable() {

            int act(int value) {
                Person user = new Person();
                user.setAge(value);

                return user.getAge();
            }
        });
    }
View Full Code Here

    @Test
    public void UserClassToString() {
        test(new Scriptable() {

            String act(String value) {
                Person user = new Person();
                user.setAge(17);
                user.setName(value);

                return user.toString();
            }
        });
    }
View Full Code Here

        assertDiff(nest(prev), nest(next), 3);
    }

    @Test
    public void changeBeanProperty() {
        Person person = new Person();

        person.setName("Yukina");
        person.setAge(14);
        VirtualStructure prev = bean(person);

        person.setName("Asagi");
        person.setAge(15);
        VirtualStructure next = bean(person);

        assertDiff(prev, next, 2);
    }
View Full Code Here

        assertDiff(prev, next, 2);
    }

    @Test
    public void changeBeanObject() {
        Person person = new Person();
        person.setName("Yukina");
        person.setAge(14);
        VirtualStructure prev = bean(person);

        person = new Person();
        person.setName("Asagi");
        person.setAge(15);
        VirtualStructure next = bean(person);

        assertDiff(prev, next, 1);
    }
View Full Code Here

        assert storage.getItem("1") == null;
    }

    @Test
    public void model() throws Exception {
        Person person = new Person();
        person.setAge(16);
        person.setName("Yuigahama Yui");

        Storage storage = Global.localStorage;
        storage.set(person);

        Person other = storage.get(Person.class);
        assert other.getAge() == 16;
        assert other.getName().equals("Yuigahama Yui");
    }
View Full Code Here

TOP

Related Classes of booton.sample.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.