Ejemplo n.º 1
0
 public void TrackSendsCustomEvent()
 {
     using (LdClient client = MakeClient(user))
     {
         client.Track("eventkey");
         Assert.Collection(eventProcessor.Events,
                           e => CheckIdentifyEvent(e, user),
                           e => {
             CustomEvent ce = Assert.IsType <CustomEvent>(e);
             Assert.Equal("eventkey", ce.EventKey);
             Assert.Equal(user.Key, ce.User.Key);
             Assert.Equal(LdValue.Null, ce.Data);
             Assert.Null(ce.MetricValue);
             Assert.NotEqual(0, ce.Timestamp.Value);
         });
     }
 }
Ejemplo n.º 2
0
 public void TrackWithMetricValueSendsCustomEvent()
 {
     using (LdClient client = MakeClient(user))
     {
         LdValue data        = LdValue.Of("hi");
         double  metricValue = 1.5;
         client.Track("eventkey", data, metricValue);
         Assert.Collection(eventProcessor.Events,
                           e => CheckIdentifyEvent(e, user),
                           e => {
             CustomEvent ce = Assert.IsType <CustomEvent>(e);
             Assert.Equal("eventkey", ce.EventKey);
             Assert.Equal(user.Key, ce.User.Key);
             Assert.Equal(data, ce.Data);
             Assert.Equal(metricValue, ce.MetricValue);
             Assert.NotEqual(0, ce.Timestamp.Value);
         });
     }
 }