df
11/28/2019, 4:00 PMfun createAddCartItemDto(
partnerId: Long = 29L,
productId: Long = 40L,
productVariantLabel: String = "A1",
testName: String? = null,
bucketGroup: String? = null
) = AddCartItemDto(
partnerId = partnerId,
productId = productId,
productVariantLabel = productVariantLabel,
bucketGroup = bucketGroup,
testName = testName
)
but i'm not the biggest fan of the duplicated parameter list .. better ideas?marstran
11/28/2019, 4:04 PMfun createAddCartItemDto(
partnerId: Long = 29L,
productId: Long = 40L,
productVariantLabel: String = "A1",
testName: String? = null,
bucketGroup: String? = null
) = AddCartItemDto(partnerId, productId, productVariantLabel, bucketGroup, testName)
df
11/28/2019, 4:08 PMgian
11/28/2019, 4:16 PMMike
11/28/2019, 6:14 PMcreateAddCartItemDto
function required? It seems like the constructor would be just as useful, and save some code.df
11/29/2019, 12:22 AMdf
11/29/2019, 12:26 AMfun `adding a product with variant a1 to the cart should remove shipping fees`()
{
val emptyCart = UUID.randomUuid();
val dto = AddCartItemDto(productVariantLabel = 'A1')
val cart = addItemToCart(emptyCart, dto)
assertTrue(cart.charges.none { it.type == 'shipping_fee' })
}
vs.df
11/29/2019, 12:26 AMfun `adding a product with variant a1 to the cart should remove shipping fees`()
{
val emptyCart = UUID.randomUuid();
val dto = AddCartItemDto(
partnerId = 29L,
productId = 40L,
productVariantLabel = "A1",
testName = null,
bucketGroup = null
)
val cart = addItemToCart(emptyCart, dto)
assertTrue(cart.charges.none { it.type == 'shipping_fee' })
}