private void ActionBtn_Click(object sender, RoutedEventArgs e) { MATEventItem item1 = new MATEventItem("test item"); List<MATEventItem> items = new List<MATEventItem>(); items.Add(item1); mobileAppTracker.MeasureAction("test event", 0.99, "USD", "123", items); }
public override bool Equals(Object obj) { // If parameter is null return false. if (obj == null) { return(false); } // If parameter cannot be cast to MATEventItem return false. MATEventItem p = obj as MATEventItem; if ((Object)p == null) { return(false); } // Return true if the fields match: return(item.Equals(p.item) && quantity.Equals(p.quantity) && unit_price.Equals(p.unit_price) && revenue.Equals(p.revenue) && attribute_sub1.Equals(p.attribute_sub1) && attribute_sub2.Equals(p.attribute_sub2) && attribute_sub3.Equals(p.attribute_sub3) && attribute_sub4.Equals(p.attribute_sub4) && attribute_sub5.Equals(p.attribute_sub5)); }
public async Task EventItemsTest() { string eventName = "testEventItem"; double revenue = 14.99; string currency = "USD"; string refId = "1234"; MATEventItem item1 = new MATEventItem("testItem", 15, 1.05, 12.34, "attribute1", "attribute2", "attribute3", "attribute4", "attribute5"); MATEventItem item2 = new MATEventItem("testItem2", 9, 2.99, 19.99, "sword1", "sword2", "sword3", "sword4", "sword5"); List<MATEventItem> itemList = new List<MATEventItem>(); itemList.Add(item1); itemList.Add(item2); MATTestWrapper.Instance.MeasureAction(eventName, revenue, currency, refId, itemList); await Task.Delay(TimeSpan.FromSeconds(5)); Assert.IsTrue(param.CheckDefaultValues()); Assert.IsTrue(param.CheckActionIsConversion()); Assert.IsTrue(param.CheckKeyIsEqualToValue("site_event_name", eventName)); Assert.IsTrue(param.CheckKeyIsEqualToValue("revenue", revenue.ToString())); Assert.IsTrue(param.CheckKeyIsEqualToValue("currency_code", currency)); Assert.IsTrue(param.CheckKeyIsEqualToValue("advertiser_ref_id", refId)); Assert.IsTrue(param.CheckEventItems(itemList)); }
public async Task ActionEventItemsTest() { MATEventItem item1 = new MATEventItem("testItem", 15, 1.05, 12.34, "attribute1", "attribute2", "attribute3", "attribute4", "attribute5"); MATEventItem item2 = new MATEventItem("testItem2", 9, 2.99, 19.99, "sword1", "sword2", "sword3", "sword4", "sword5"); List<MATEventItem> itemList = new List<MATEventItem>(); itemList.Add(item1); itemList.Add(item2); MATTestWrapper.Instance.MeasureAction("testEventItems", 0, "USD", "1234", itemList); await Task.Delay(TimeSpan.FromSeconds(5)); Assert.IsTrue(callSuccess); Assert.IsFalse(callFailed); }