text: "use strict";
  
  var _fakeAppointmentsRepository = _interopRequireDefault(require("../repositories/fakes/fakeAppointmentsRepository"));
  
  var _ListProviderAppointmentsService = _interopRequireDefault(require("./ListProviderAppointmentsService"));
  
  var _FakeCacheProvider = _interopRequireDefault(require("../../../shared/container/providers/CacheProvider/fakes/FakeCacheProvider"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  let fakeAppointmentsRepository;
  let listProviderAppointmentsService;
  let fakeCacheProvider;
  describe('List Provider Appointments', () => {
    beforeEach(() => {
      fakeAppointmentsRepository = new _fakeAppointmentsRepository.default();
      fakeCacheProvider = new _FakeCacheProvider.default();
      listProviderAppointmentsService = new _ListProviderAppointmentsService.default(fakeAppointmentsRepository, fakeCacheProvider);
    });
    it("should be able to list the appointments on a specific day", async () => {
      const appointment1 = await fakeAppointmentsRepository.create({
        provider_id: 'provider',
        user_id: 'user',
        date: new Date(2020, 4, 20, 14, 0, 0)
      });
      const appointment2 = await fakeAppointmentsRepository.create({
        provider_id: 'provider',
        user_id: 'user',
        date: new Date(2020, 4, 20, 15, 0, 0)
      });
      const appointments = await listProviderAppointmentsService.execute({
        provider_id: 'provider',
        year: 2020,
        month: 5,
        day: 20
      });
      expect(appointments).toEqual([appointment1, appointment2]);
    });
  });