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());
}
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());
}
Aggregations