Package er.erxtest.model

Examples of er.erxtest.model.Company.employees()


    Company company = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompany(company);

    assertEquals(company, p1.company());
    assertEquals(1, company.employees().count());
    assertEquals(p1, company.employees().objectAtIndex(0));
  }

  public void testAutoAddToToManyImplicitToOne() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
View Full Code Here


    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompany(company);

    assertEquals(company, p1.company());
    assertEquals(1, company.employees().count());
    assertEquals(p1, company.employees().objectAtIndex(0));
  }

  public void testAutoAddToToManyImplicitToOne() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
View Full Code Here

    Company company = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    company.addToEmployees(p1);

    assertEquals(company, p1.company());
    assertEquals(1, company.employees().count());
    assertEquals(p1, company.employees().objectAtIndex(0));
  }

  public void testAutoSetThenSetToOneToNullImplicitToMany() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
View Full Code Here

    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    company.addToEmployees(p1);

    assertEquals(company, p1.company());
    assertEquals(1, company.employees().count());
    assertEquals(p1, company.employees().objectAtIndex(0));
  }

  public void testAutoSetThenSetToOneToNullImplicitToMany() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
View Full Code Here

    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompany(company);
    p1.setCompany(null);
  
    assertEquals(null, p1.company());
    assertEquals(0, company.employees().count());
  }

  public void testAutoSetThenSetToOneToAnotherImplicitToMany() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
View Full Code Here

        assertEquals(
            "The attribute named 'address1' in the entity named 'Company' is not a toMany relationship! Expected an NSArray, but got null.",
            exception.getMessage());
      }

      e = c.employees().objectAtIndex(0);

      EOGlobalID eGid = ec.globalIDForObject(e);
      try {
        // Company is not null
        count = ERXEOControlUtilities.objectCountForToManyRelationship(e, Employee.COMPANY_KEY);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.