<commit_before><?php

use Concierge\Booking\Strategies\BookingStrategy;
use App\Models\Appointment;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class BookingStrategyUnitTest extends TestCase
{
    use DatabaseTransactions;
    use CreateUser, CreateContact, CreateBusiness, CreateService;

    /**
     * @covers  App\BookingStrategy::generateAppointment
     * @covers  App\BookingDateslotStrategy::generateAppointment
     * @test
     */
    public function it_generates_a_dateslot_appointment()
    {
        $owner = $this->createUser();

        $contact = $this->makeContact($owner);
        $contact->save();

        $business = $this->makeBusiness($owner, ['strategy' => 'dateslot']);
        $business->save();

        $service = $this->makeService();

        $business->services()->save($service);

        $bookingStrategy = new BookingStrategy($business->strategy);

        $dateTime = Carbon::now()->addDays(5);

        $appointment = $bookingStrategy->generateAppointment(
            $owner,
            $business,
            $contact,
            $service,
            $dateTime,
            'test comments'
        );

        $this->assertInstanceOf(Appointment::class, $appointment);

        $this->assertEquals($appointment->issuer->id, $owner->id);
        $this->assertEquals($appointment->contact->name, $contact->name);
        $this->assertEquals($appointment->service->name, $service->name);
        $this->assertEquals($appointment->date, $dateTime->toDateString());
        $this->assertEquals($appointment->comments, 'test comments');

        $this->assertEquals(32, strlen($appointment->hash));
    }

    /**
     * @covers  App\BookingStrategy::generateAppointment
     * @covers  App\BookingDateslotStrategy::generateAppointment
     * @test
     */
    public function it_generates_a_timeslot_appointment()
    {
        $owner = $this->createUser();

        $contact = $this->makeContact($owner);
        $contact->save();

        $business = $this->makeBusiness($owner, ['strategy' => 'timeslot']);
        $business->save();

        $service = $this->makeService();

        $business->services()->save($service);

        $bookingStrategy = new BookingStrategy($business->strategy);
<commit_msg>Update @cover path<commit_after><?php

use Concierge\Booking\Strategies\BookingStrategy;
use App\Models\Appointment;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class BookingStrategyUnitTest extends TestCase
{
    use DatabaseTransactions;
    use CreateUser, CreateContact, CreateBusiness, CreateService;

    /**
     * @covers  Concierge\Booking\Strategies\BookingStrategy::generateAppointment
     * @covers  Concierge\Booking\Strategies\BookingDateslotStrategy::generateAppointment
     * @test
     */
    public function it_generates_a_dateslot_appointment()
    {
        $owner = $this->createUser();

        $contact = $this->makeContact($owner);
        $contact->save();

        $business = $this->makeBusiness($owner, ['strategy' => 'dateslot']);
        $business->save();

        $service = $this->makeService();

        $business->services()->save($service);

        $bookingStrategy = new BookingStrategy($business->strategy);

        $dateTime = Carbon::now()->addDays(5);

        $appointment = $bookingStrategy->generateAppointment(
            $owner,
            $business,
            $contact,
            $service,
            $dateTime,
            'test comments'
        );

        $this->assertInstanceOf(Appointment::class, $appointment);

        $this->assertEquals($appointment->issuer->id, $owner->id);
        $this->assertEquals($appointment->contact->name, $contact->name);
        $this->assertEquals($appointment->service->name, $service->name);
        $this->assertEquals($appointment->date, $dateTime->toDateString());
        $this->assertEquals($appointment->comments, 'test comments');

        $this->assertEquals(32, strlen($appointment->hash));
    }

    /**
     * @covers  Concierge\Booking\Strategies\BookingStrategy::generateAppointment
     * @covers  Concierge\Booking\Strategies\BookingDateslotStrategy::generateAppointment
     * @test
     */
    public function it_generates_a_timeslot_appointment()
    {
        $owner = $this->createUser();

        $contact = $this->makeContact($owner);
        $contact->save();

        $business = $this->makeBusiness($owner, ['strategy' => 'timeslot']);
        $business->save();

        $service = $this->makeService();

        $business->services()->save($service);

        $bookingStrategy = new BookingStrategy($business->strategy);

{'fraction_non_alphanumeric': 0.14702725906846964, 'fraction_numerical': 0.00128783000643915, 'mean_word_length': 3.1275465013286095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1871106', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1299, 'n_words': 190}