public void MeasurementActivityTracker_GetParameter_For_TransactionItemActivity_Returns_Correct_Values() { var tracker = new MeasurementActivityTracker(); var transaction = new TransactionActivity { OrderId = "567", Currency = "GBP" }; tracker.GetActivityParameters(transaction); var activity = new TransactionItemActivity("code", "name", 1.23m, 4096, "variation"); var parameters = tracker.GetParameters(activity).ToDictionary(k => k.Key, v => v.Value); Assert.AreEqual(8, parameters.Keys.Count); Assert.AreEqual("item", parameters["t"]); Assert.AreEqual("567", parameters["ti"]); Assert.AreEqual("GBP", parameters["cu"]); Assert.AreEqual("code", parameters["ic"]); Assert.AreEqual("name", parameters["in"]); Assert.AreEqual("1.23", parameters["ip"]); Assert.AreEqual("4096", parameters["iq"]); Assert.AreEqual("variation", parameters["iv"]); }
public void MeasurementActivityTracker_GetParameter_For_TransactionActivity_Returns_Correct_Values() { var tracker = new MeasurementActivityTracker(); var activity = new TransactionActivity { OrderId = "12345", Currency = "USD", OrderTotal = 109.76m, ShippingCost = 11.27m, StoreName = "My Store", TaxCost = 8.18m }; var parameters = tracker.GetParameters(activity).ToDictionary(k => k.Key, v => v.Value); Assert.AreEqual(7, parameters.Keys.Count); Assert.AreEqual("transaction", parameters["t"]); Assert.AreEqual("12345", parameters["ti"]); Assert.AreEqual("USD", parameters["cu"]); Assert.AreEqual("109.76", parameters["tr"]); Assert.AreEqual("11.27", parameters["ts"]); Assert.AreEqual("My Store", parameters["ta"]); Assert.AreEqual("8.18", parameters["tt"]); }