Exemplo n.º 1
0
    public bool AddPet(string[] args)
    {
        string petsName = args[1];

        Pet pet = pets.FirstOrDefault(p => p.Name == petsName);

        if (pet == null)
        {
            throw new InvalidOperationException("Invalid pet or clinic");
        }

        string clinicName = args[2];

        Clinic clinic = FindClinic(clinicName);

        return(clinic.Accommodate(pet));
    }