GitHub

MockDaffProductFacade

Facade

import { MockDaffProductFacade } from '@daffodil/product/state/testing'

@Injectable()
class MockDaffProductFacade implements DaffProductFacadeInterface {
  getProduct(id: string): any
  getPrice(id: string): any
  hasDiscount(id: string): any
  getDiscountAmount(id: string): any
  getDiscountedPrice(id: string): any
  getDiscountPercent(id: string): any
  isOutOfStock(id: string): any
  dispatch(action): void
}

() Methods

getProduct
any

Get a product.

Parameters
Parameterid: string
Description
getPrice
any

Get the original price for a product.

Parameters
Parameterid: string
Description
hasDiscount
any

Whether a particular product has a discount.

Parameters
Parameterid: string
Description
getDiscountAmount
any

Get the discount amount of a product.

Parameters
Parameterid: string
Description
getDiscountedPrice
any

Get the discounted price for a product.

Parameters
Parameterid: string
Description
getDiscountPercent
any

Get the discount percent of a product.

Parameters
Parameterid: string
Description
isOutOfStock
any

Whether a product is out of stock.

Parameters
Parameterid: string
Description
dispatch
void
Parameters
Parameteraction: undefined
Description