public void CheckExportedOnEnd()
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new ReentrantExportProcessor <Activity>(exporter);

            processor.OnEnd(new Activity("start1"));
            Assert.Single(exporter.Exported);

            processor.OnEnd(new Activity("start2"));
            Assert.Equal(2, exporter.Exported.Count);
        }
        public void CheckShutdownExport(int timeout)
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new ReentrantExportProcessor <Activity>(exporter);

            processor.OnEnd(new Activity("start"));

            // checking before shutdown
            Assert.Single(exporter.Exported);

            processor.Shutdown(timeout);
            Assert.Single(exporter.Exported);
        }
        public void CheckExportedOnEnd()
        {
            var exportedItems = new List <object>();

            using var exporter  = new InMemoryExporter <Activity>(new InMemoryExporterOptions { ExportedItems = exportedItems });
            using var processor = new ReentrantExportProcessor <Activity>(exporter);

            processor.OnEnd(new Activity("start1"));
            Assert.Single(exportedItems);

            processor.OnEnd(new Activity("start2"));
            Assert.Equal(2, exportedItems.Count);
        }
        public void CheckForceFlushExport(int timeout)
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new ReentrantExportProcessor <Activity>(exporter);

            processor.OnEnd(new Activity("start1"));
            processor.OnEnd(new Activity("start2"));

            // checking before force flush
            Assert.Equal(2, exporter.Exported.Count);

            // forcing flush
            processor.ForceFlush(timeout);
            Assert.Equal(2, exporter.Exported.Count);
        }
        public void CheckShutdownExport(int timeout)
        {
            var exportedItems = new List <object>();

            using var exporter  = new InMemoryExporter <Activity>(new InMemoryExporterOptions { ExportedItems = exportedItems });
            using var processor = new ReentrantExportProcessor <Activity>(exporter);

            processor.OnEnd(new Activity("start"));

            // checking before shutdown
            Assert.Single(exportedItems);

            processor.Shutdown(timeout);
            Assert.Single(exportedItems);
        }
        public void CheckForceFlushExport(int timeout)
        {
            var exportedItems = new List <object>();

            using var exporter  = new InMemoryExporter <Activity>(new InMemoryExporterOptions { ExportedItems = exportedItems });
            using var processor = new ReentrantExportProcessor <Activity>(exporter);

            processor.OnEnd(new Activity("start1"));
            processor.OnEnd(new Activity("start2"));

            // checking before force flush
            Assert.Equal(2, exportedItems.Count);

            // forcing flush
            processor.ForceFlush(timeout);
            Assert.Equal(2, exportedItems.Count);
        }