Skip to content

Instantly share code, notes, and snippets.

@bentayloruk
Created November 11, 2012 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bentayloruk/4054248 to your computer and use it in GitHub Desktop.
Save bentayloruk/4054248 to your computer and use it in GitHub Desktop.
Issue 261 Investigation Test
module IssueInvestiations
open Xunit
open Enticify.Promotions
[<Fact>]
let ``Issue 261 - item and shipping discount interaction`` () =
let (basket, orderForm) =
createBasket
[ Spid("AW475-14", 1m);(* Scout pride cook kit. In discount. *)
Vpid("AW190-11", "16", 1m);(* Tent, not in discount.*) ]
let result =
basket
|> (setAllowedDiscounts ["500261"; "5002612"])
|> (addCoupon "sp123")
|> runPipeline
Assert.Equal(0m, orderForm.ShippingTotal)
Assert.Equal<string>("Item", (orderForm.LineItems.[0].ItemLevelDiscountsApplied.[0].["discount_target"].ToString()))
()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment