I have a private method as below. How can I unit test this private method?
Is there a pattern that can be adopted to test these kind of private methods?
private ICart GetCart(ICart cart, IEnumerable<ILine> lines)
{
var discountedCart = new Cart()
{
Company = cart.Company,
DiscountedSubtotal = cart.DiscountedSubtotal,
Discounts = cart.Discounts,
DiscountValue = cart.DiscountValue,
Id = cart.Id,
Items = cart.Items,
};
var validItems = GetValidItems(discountedCart.Items, lines);
discountedCart.Items.Clear();
discountedCart.Items = validItems.ToList();
return discountedCart;
}