def test_add_contact_duplicated(service: AttachContactToReservation,
                                context: Context, reservation):
    context.reservation = attr.evolve(reservation,
                                      guest_contact_id=10,
                                      guest_contact_ids=[10, 200])

    result = service.add_contact(context)
    assert is_successful(result)
    assert result.unwrap().reservation.guest_contact_id == 10
    assert result.unwrap().reservation.guest_contact_ids == [10, 200]
def test_add_contact_first(service: AttachContactToReservation,
                           context: Context, reservation):
    context.reservation = attr.evolve(reservation,
                                      guest_contact_id=None,
                                      guest_contact_ids=[])

    result = service.add_contact(context)
    assert is_successful(result)
    assert result.unwrap().reservation.guest_contact_id == 200
    assert result.unwrap().reservation.guest_contact_ids == [200]