Package er.erxtest.model

Examples of er.erxtest.model.Role


 
  public void testSnapshot() {
    EOEditingContext ec = ERXEC.newEditingContext();
    Company company = Company.createCompany(ec, "Test Company");
    Employee employee = Employee.createEmployee(ec, "John", "Doe", Boolean.FALSE, company);
    Role role1 = Role.createRole(ec);
    employee.addToRoles(role1);
   
    NSDictionary<String, Object> snapshot = employee.snapshot();
    NSDictionary committedSnapshot = employee.committedSnapshot();
   
    /*
     * Snapshot should have same values as the eo and committed snapshot should be all
     * null values as eo has not yet been saved.
     */
    EOEntity entity = employee.entity();
    for (String key : (NSArray<String>) entity.classPropertyNames()) {
      Object snapshotValue = snapshot.valueForKey(key);
      assertEquals(employee.valueForKey(key), ERXValueUtilities.isNull(snapshotValue) ? null : snapshotValue);
      assertTrue(ERXValueUtilities.isNull(committedSnapshot.valueForKey(key)));
    }
   
    ec.saveChanges();
   
    Role role2 = Role.createRole(ec);
    employee.addToRoles(role2);
    employee.removeFromRoles(role1);
   
    NSDictionary changesFromCommittedSnapshot = employee.changesFromCommittedSnapshot();
   
View Full Code Here


  public void testFetchWithRelationshipQualifier() {
    EOEditingContext ec = ERXEC.newEditingContext();
   
    Company company = Company.createCompany(ec, "Fetch Test Company");
    Employee employee = Employee.createEmployee(ec, "Fetch", "Test", Boolean.FALSE, company);
    Role role = Role.createRole(ec);
    employee.addToRoles(role);
    Paycheck paycheck = Paycheck.createPaycheck(ec, new BigDecimal(10), Boolean.FALSE, new NSTimestamp(), employee);
   
    ec.saveChanges();
   
View Full Code Here

TOP

Related Classes of er.erxtest.model.Role

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.