Skip to content

Commit

Permalink
Changes all getters to public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Jun 4, 2019
1 parent 14ce30f commit df87d3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
27 changes: 9 additions & 18 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,62 +19,53 @@ it('will be constructed properly', async () => {
it('can access the user resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('users');
expect(instance.users).toBeInstanceOf(User.prototype.constructor);
expect(instance.users()).toBeInstanceOf(User.prototype.constructor);
});

it('can access the setting resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('settings');
expect(instance.settings).toBeInstanceOf(Setting.prototype.constructor);
expect(instance.settings()).toBeInstanceOf(Setting.prototype.constructor);
});

it('can access the service resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('services');
expect(instance.services).toBeInstanceOf(Service.prototype.constructor);
expect(instance.services()).toBeInstanceOf(Service.prototype.constructor);
});

it('can access the question resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('questions');
expect(instance.questions).toBeInstanceOf(Question.prototype.constructor);
expect(instance.questions()).toBeInstanceOf(Question.prototype.constructor);
});

it('can access the location resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('locations');
expect(instance.locations).toBeInstanceOf(Location.prototype.constructor);
expect(instance.locations()).toBeInstanceOf(Location.prototype.constructor);
});

it('can access the slots resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('slots');
expect(instance.slots).toBeInstanceOf(TimeSlot.prototype.constructor);
expect(instance.slots()).toBeInstanceOf(TimeSlot.prototype.constructor);
});

it('can access the wait list resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('lists');
expect(instance.lists).toBeInstanceOf(WaitList.prototype.constructor);
expect(instance.lists()).toBeInstanceOf(WaitList.prototype.constructor);
});

it('can access the appointment resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('appointments');
expect(instance.appointments).toBeInstanceOf(Appointment.prototype.constructor);
expect(instance.appointments()).toBeInstanceOf(Appointment.prototype.constructor);
});

it('can access the timezone resource', async () => {
const instance = new OpenApi('admin');

expect(instance).toHaveProperty('timezones');
expect(instance.timezones).toBeInstanceOf(Timezone.prototype.constructor);
expect(instance.timezones()).toBeInstanceOf(Timezone.prototype.constructor);
});
18 changes: 9 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,39 +74,39 @@ export class OpenApi {
this.user = new User(this.client);
}

get appointments(): AppointmentResource {
public appointments(): AppointmentResource {
return this.appointment;
}

get lists(): WaitListResource {
public lists(): WaitListResource {
return this.list;
}

get locations(): LocationResource {
public locations(): LocationResource {
return this.location;
}

get questions(): QuestionResource {
public questions(): QuestionResource {
return this.question;
}

get services(): ServiceResource {
public services(): ServiceResource {
return this.service;
}

get settings(): Resource {
public settings(): Resource {
return this.setting;
}

get slots(): TimeSlotResource {
public slots(): TimeSlotResource {
return this.slot;
}

get timezones(): Resource {
public timezones(): Resource {
return this.timezone;
}

get users(): UserResource {
public users(): UserResource {
return this.user;
}
}

0 comments on commit df87d3d

Please sign in to comment.