public void CanRecordEventsInBatch()
        {
            var store = new DiagnosticStoreImpl();

            store.RecordEventsInBatch(4);
            DiagnosticEvent periodicEvent = store.CreateEventAndReset();

            Assert.Equal(4, periodicEvent.JsonValue.Get("eventsInLastBatch").AsInt);
        }
        public void CreatingEventResetsFields()
        {
            var store = new DiagnosticStoreImpl();

            store.IncrementDroppedEvents();
            store.IncrementDeduplicatedUsers();
            store.RecordEventsInBatch(10);
            store.AddStreamInit(DateTime.Now, TimeSpan.FromMilliseconds(200.0), true);
            LdValue firstPeriodicEvent = store.CreateEventAndReset().JsonValue;
            LdValue nextPeriodicEvent  = store.CreateEventAndReset().JsonValue;

            Assert.Equal(firstPeriodicEvent.Get("creationDate"), nextPeriodicEvent.Get("dataSinceDate"));
            Assert.Equal(0, nextPeriodicEvent.Get("eventsInLastBatch").AsInt);
            Assert.Equal(0, nextPeriodicEvent.Get("droppedEvents").AsInt);
            Assert.Equal(0, nextPeriodicEvent.Get("deduplicatedUsers").AsInt);
            Assert.Equal(0, nextPeriodicEvent.Get("eventsInLastBatch").AsInt);
            LdValue streamInits = nextPeriodicEvent.Get("streamInits");

            Assert.Equal(0, streamInits.Count);
        }