@@ -0,0 +1,1964 @@
+package me.pedrohenriquerls.models;%0A%0Aimport org.junit.BeforeClass;%0A%0Aimport me.pedrohenriquerls.Config;%0Aimport me.pedrohenriquerls.sql2omodel.Sql2oModel;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class CompanyTest %7B%0A%0A    @BeforeClass%0A    public static void setUp() %7B%0A        Config.database = %22sampletest%22;%0A        Sql2oModel.setInstance(new Config());%0A    %7D%0A%0A    @Test%0A    public void createNewCompany() %7B%0A        Company company = createCompany();%0A        company.setName(%22Private Detective%22);%0A        assertTrue(company.save());%0A    %7D%0A%0A    @Test%0A    public void udpateCompany() %7B%0A        Company company = createCompany();%0A        company.setName(%22Private Detective%22);%0A%0A        assertTrue(company.save());%0A        assertNotNull(company.getCompanyUuid());%0A%0A        company.setName(%22Blastoise%22);%0A        assertTrue(company.save());%0A%0A        Company persistedCompany = Company.getCompanyOn(company.getCompanyUuid());%0A        assertEquals(persistedCompany.getName(), %22Blastoise%22);%0A    %7D%0A%0A    @Test%0A    public void getCompany()%7B%0A        Company company = createCompany();%0A        company.setName(%22Private Detective%22);%0A        assertTrue(company.save());%0A%0A        Company persistedCompany = Company.getCompanyOn(company.getCompanyUuid());%0A        assertNotNull(persistedCompany);%0A%0A        assertEquals(persistedCompany.getName(), company.getName());%0A        assertEquals(persistedCompany.getAddress(), company.getAddress());%0A        assertEquals(persistedCompany.getCity(), company.getCity());%0A        assertEquals(persistedCompany.getCountry(), company.getCountry());%0A    %7D%0A%0A    @Test%0A    public void failCreateNewCompany() %7B%0A        Company company = createCompany();%0A        assertFalse(company.save());%0A    %7D%0A%0A    private Company createCompany()%7B%0A        Company company = new Company();%0A%0A        company.setAddress(%22Backer Street%22);%0A        company.setCity(%22London%22);%0A        company.setCountry(%22England%22);%0A        return company;%0A    %7D%0A%7D

test for company model