Skip to content

Commit

Permalink
feature #4 - update currency exchange repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeniosales committed Oct 16, 2022
1 parent 1c26924 commit dde671d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/2-business/repositories/iExchangeRateRepository.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ExchangeRate } from '../../1-domain/entities/exchangeRate'
import { CurrencyEnum } from '../enums/currencyEnum'

export interface IExchangeRateRepository {
upsert (entity: ExchangeRate): Promise<ExchangeRate>
get (baseCurrency: CurrencyEnum): Promise<ExchangeRate>
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ describe('UpdateExchangeRateUseCase', () => {

const setMocks = () => {
exchangeRateRepository = {
upsert: jest.fn().mockResolvedValue(null)
upsert: jest.fn().mockResolvedValue(null),
get: jest.fn()
}
exchangeRateService = {
getLatestRates: jest.fn().mockResolvedValue(exchangeRateResponseMock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ describe('UpdateExchangeRateController', () => {

const setMocks = () => {
exchangeRateRepository = {
upsert: jest.fn().mockResolvedValue(null)
upsert: jest.fn().mockResolvedValue(null),
get: jest.fn().mockResolvedValue(null)
}
exchangeRateService = {
getLatestRates: jest.fn().mockResolvedValue(exchangeRateResponseMock)
Expand Down

0 comments on commit dde671d

Please sign in to comment.