public async Task TrackEventFailsWithoutIdentity() { var customerIo = new CustomerIo(SiteId, ApiKey); await Assert.ThrowsAsync <CustomerIoApiException>(async() => await customerIo.TrackEventAsync("signup", new { Group = "trial", Referrer = "email campaign" })); }
public async Task TriggerBroadcast() { var customerIo = new CustomerIo(SiteId, ApiKey); await customerIo.TriggerBroadcastAsync( BroadcastCampaignId, new { Name = "Name 1", TestKey = "Value 2" }); }
public async Task TrackEvent() { var customerIo = new CustomerIo(SiteId, ApiKey); await customerIo.TrackEventAsync("signup", new { Group = "trial", Referrer = "email campaign" }, null, "from_static_identity"); }
public async Task TriggerBroadcastWithRecipientFilter() { var customerIo = new CustomerIo(SiteId, ApiKey); await customerIo.TriggerBroadcastAsync( BroadcastCampaignId, new { Name = "Name 1", TestKey = "Value 2" }, new { segment = new { id = BroadcastSegmentId } }); }
public async Task IdentifyAsyncFailsIfNotGivenIdentity() { var customerIo = new CustomerIo(SiteId, ApiKey); await Assert.ThrowsAsync <ArgumentNullException>(async() => await customerIo.IdentifyAsync()); }
public async Task IdentifyAsyncSucceedsWithIdentityFactoryAndCustomCustomerDetails() { var customerIo = new CustomerIo(SiteId, ApiKey, new IdentityFactoryWithExtraCustomerDetails()); await customerIo.IdentifyAsync(); }
public async Task IdentifyAsyncSucceedsWithIdentityFactory() { var customerIo = new CustomerIo(SiteId, ApiKey, new IdentityFactory()); await customerIo.IdentifyAsync(); }
public async Task IdentifyAsyncSucceedsWithStaticIdentity() { var customerIo = new CustomerIo(SiteId, ApiKey); await customerIo.IdentifyAsync(new CustomerDetails("from_static_identity", "*****@*****.**")); }