// Path: main-kata/src/main/java/kata/domain/Person.java
// public class Person
//         extends PersonAbstract
// {
//     // Added for ExercisesAdvancedFinder question 9
//     public static final Procedure<Person> INCREMENT_AGE = new Procedure<Person>()
//     {
//         public void value(Person person)
//         {
//             person.incrementAge();
//         }
//     };
// 
// 	public Person()
// 	{
// 		super();
// 		// You must not modify this constructor. Mithra calls this internally.
// 		// You can call this constructor. You can also add new constructors.
// 	}
// 
//     // Added for ExercisesAdvancedFinder question 9
//     public void incrementAge()
//     {
//         this.setAge(this.getAge() + 1);
// 	}
// 
//     @Override
//     public String toString()
//     {
//         return "Person[name=" + this.getName()
//                 + "; country=" + this.getCountry()
//                 + "; age=" + this.getAge() + ']';
//     }
// }
// 
// Path: main-kata/src/main/java/kata/domain/PersonList.java
// public class PersonList
//         extends PersonListAbstract
// {
// 	public PersonList()
// 	{
// 		super();
// 	}
// 
// 	public PersonList(int initialSize)
// 	{
// 		super(initialSize);
// 	}
// 
// 	public PersonList(Collection c)
// 	{
// 		super(c);
// 	}
// 
// 	public PersonList(Operation operation)
// 	{
// 		super(operation);
// 	}
// }
// 
// Path: mini-kata/src/main/java/kata/domain/PetList.java
// public class PetList extends PetListAbstract
// {
//     public PetList()
//     {
//         super();
//     }
// 
//     public PetList(int initialSize)
//     {
//         super(initialSize);
//     }
// 
//     public PetList(Collection c)
//     {
//         super(c);
//     }
// 
//     public PetList(Operation operation)
//     {
//         super(operation);
//     }
// 
//     /**
//      * For each element in the list, print out petName() + " plays".
//      */
//     public void play()
//     {
//         throw new UnsupportedOperationException("Implement this as a part of kata.testExercise4Test.makePetsPlay");
//     }
// }


import com.gs.fw.common.mithra.finder.Operation;
import kata.domain.Person;
import kata.domain.PersonFinder;
import kata.domain.PersonList;
import kata.domain.PetList;
import org.eclipse.collections.impl.test.Verify;
import org.junit.Assert;
import org.junit.Test;
/*
 Copyright 2018 Goldman Sachs.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied. See the License for the
 specific language governing permissions and limitations
 under the License.
 */

package kata.test;


public class Exercise1Test extends AbstractMithraTest
{
    /**
     * Find all the {@code Person} objects.
     * Use the appropriate method on {@link kata.domain.PersonFinder}.
     */
    @Test
    public void getAllPeople()
    {
        PersonList people = null;
        Verify.assertSize(8, people);
    }

    /**
     * Find all the {@code Person} objects with {@code lastName().eq("Smith")}.
     * Use the appropriate method on {@link kata.domain.PersonFinder}
     */
    @Test
    public void getAllSmiths()
    {
        PersonList smiths = null;
        Verify.assertSize(3, smiths);
    }

    /**
     * Find all the {@code Pet}s which are older than 1 or if the name is "Wuzzy".
     * Explore concatenation of multiple conditions using {@code and}, {@code or}.
     * Use the appropriate method on {@link kata.domain.PetFinder}
     */
    @Test
    public void getAllPets_OlderThan1_Or_Wuzzy()
    {
        PetList oldPetsOrWuzzy = null;
        Verify.assertSize(7, oldPetsOrWuzzy);
    }

    /**
     * There are no {@code Person} objects with {@code firstName} equal to "George".
     * Bulk update the {@code firstName} of only those {@code Person} objects with {@code lastName} equal to "Smith".
     * Use the appropriate method on {@link PersonFinder} and {@link PersonList}
     */
    @Test
    public void updateAllSmithsFirstNamesToGeorge()
    {
        Operation georgeSmithOperation = PersonFinder.firstName().eq("George").and(PersonFinder.lastName().eq("Smith"));

// Path: main-kata/src/main/java/kata/domain/Person.java
// public class Person
//         extends PersonAbstract
// {
//     // Added for ExercisesAdvancedFinder question 9
//     public static final Procedure<Person> INCREMENT_AGE = new Procedure<Person>()
//     {
//         public void value(Person person)
//         {
//             person.incrementAge();
//         }
//     };
// 
// 	public Person()
// 	{
// 		super();
// 		// You must not modify this constructor. Mithra calls this internally.
// 		// You can call this constructor. You can also add new constructors.
// 	}
// 
//     // Added for ExercisesAdvancedFinder question 9
//     public void incrementAge()
//     {
//         this.setAge(this.getAge() + 1);
// 	}
// 
//     @Override
//     public String toString()
//     {
//         return "Person[name=" + this.getName()
//                 + "; country=" + this.getCountry()
//                 + "; age=" + this.getAge() + ']';
//     }
// }
// 
// Path: main-kata/src/main/java/kata/domain/PersonList.java
// public class PersonList
//         extends PersonListAbstract
// {
// 	public PersonList()
// 	{
// 		super();
// 	}
// 
// 	public PersonList(int initialSize)
// 	{
// 		super(initialSize);
// 	}
// 
// 	public PersonList(Collection c)
// 	{
// 		super(c);
// 	}
// 
// 	public PersonList(Operation operation)
// 	{
// 		super(operation);
// 	}
// }
// 
// Path: mini-kata/src/main/java/kata/domain/PetList.java
// public class PetList extends PetListAbstract
// {
//     public PetList()
//     {
//         super();
//     }
// 
//     public PetList(int initialSize)
//     {
//         super(initialSize);
//     }
// 
//     public PetList(Collection c)
//     {
//         super(c);
//     }
// 
//     public PetList(Operation operation)
//     {
//         super(operation);
//     }
// 
//     /**
//      * For each element in the list, print out petName() + " plays".
//      */
//     public void play()
//     {
//         throw new UnsupportedOperationException("Implement this as a part of kata.testExercise4Test.makePetsPlay");
//     }
// }


// Path: mini-kata/src/test/java/kata/test/Exercise1Test.java
import com.gs.fw.common.mithra.finder.Operation;
import kata.domain.Person;
import kata.domain.PersonFinder;
import kata.domain.PersonList;
import kata.domain.PetList;
import org.eclipse.collections.impl.test.Verify;
import org.junit.Assert;
import org.junit.Test;

/*
 Copyright 2018 Goldman Sachs.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied. See the License for the
 specific language governing permissions and limitations
 under the License.
 */

package kata.test;


public class Exercise1Test extends AbstractMithraTest
{
    /**
     * Find all the {@code Person} objects.
     * Use the appropriate method on {@link kata.domain.PersonFinder}.
     */
    @Test
    public void getAllPeople()
    {
        PersonList people = null;
        Verify.assertSize(8, people);
    }

    /**
     * Find all the {@code Person} objects with {@code lastName().eq("Smith")}.
     * Use the appropriate method on {@link kata.domain.PersonFinder}
     */
    @Test
    public void getAllSmiths()
    {
        PersonList smiths = null;
        Verify.assertSize(3, smiths);
    }

    /**
     * Find all the {@code Pet}s which are older than 1 or if the name is "Wuzzy".
     * Explore concatenation of multiple conditions using {@code and}, {@code or}.
     * Use the appropriate method on {@link kata.domain.PetFinder}
     */
    @Test
    public void getAllPets_OlderThan1_Or_Wuzzy()
    {
        PetList oldPetsOrWuzzy = null;
        Verify.assertSize(7, oldPetsOrWuzzy);
    }

    /**
     * There are no {@code Person} objects with {@code firstName} equal to "George".
     * Bulk update the {@code firstName} of only those {@code Person} objects with {@code lastName} equal to "Smith".
     * Use the appropriate method on {@link PersonFinder} and {@link PersonList}
     */
    @Test
    public void updateAllSmithsFirstNamesToGeorge()
    {
        Operation georgeSmithOperation = PersonFinder.firstName().eq("George").and(PersonFinder.lastName().eq("Smith"));

        PersonList georgeSmiths = PersonFinder.findMany(georgeSmithOperation);