Search in sources :

Example 11 with Cellphone

use of com.litepaltest.model.Cellphone in project LitePal by LitePalFramework.

the class ColumnTest method testNotNull.

public void testNotNull() {
    Cellphone cellphone = new Cellphone();
    cellphone.setBrand("三星");
    cellphone.setInStock('Y');
    cellphone.setPrice(1949.99);
    assertFalse(cellphone.save());
    cellphone.setSerial(UUID.randomUUID().toString());
    assertTrue(cellphone.save());
}
Also used : Cellphone(com.litepaltest.model.Cellphone)

Example 12 with Cellphone

use of com.litepaltest.model.Cellphone in project LitePal by LitePalFramework.

the class ColumnTest method testDefaultValue.

public void testDefaultValue() {
    Cellphone cellphone = new Cellphone();
    cellphone.setBrand("三星");
    cellphone.setInStock('Y');
    cellphone.setPrice(1949.99);
    cellphone.setSerial(UUID.randomUUID().toString());
    assertTrue(cellphone.save());
    assertEquals("0.0.0.0", DataSupport.find(Cellphone.class, cellphone.getId()).getMac());
    cellphone.setMac("192.168.0.1");
    assertTrue(cellphone.save());
    assertEquals("192.168.0.1", DataSupport.find(Cellphone.class, cellphone.getId()).getMac());
}
Also used : Cellphone(com.litepaltest.model.Cellphone)

Aggregations

Cellphone (com.litepaltest.model.Cellphone)12 Cursor (android.database.Cursor)1 Classroom (com.litepaltest.model.Classroom)1 IdCard (com.litepaltest.model.IdCard)1 Student (com.litepaltest.model.Student)1 Teacher (com.litepaltest.model.Teacher)1 WeChatMessage (com.litepaltest.model.WeChatMessage)1 WeiboMessage (com.litepaltest.model.WeiboMessage)1 ArrayList (java.util.ArrayList)1