Esempio n. 1
0
        public void SendOne()
        {
            var telemetry = CreateTelemetry();
            var queue     = new TelemetryQueue();

            queue.Send(telemetry);
            Assert.AreEqual(1, queue.Count);
        }
Esempio n. 2
0
        public void SendTen()
        {
            var queue = new TelemetryQueue();

            for (var i = 0; i < 10; i++)
            {
                var telemetry = CreateTelemetry();
                queue.Send(telemetry);
                Assert.AreEqual(i + 1, queue.Count);
            }
        }
Esempio n. 3
0
        public void ReceiveOne()
        {
            var trigger = new ManualResetEvent(false);

            var telemetry = CreateTelemetry();
            var queue     = new TelemetryQueue(message =>
            {
                Assert.AreSame(telemetry, message);
                trigger.Set();
            });

            queue.Send(telemetry);
            Assert.AreEqual(1, queue.Count);

            trigger.WaitOne();
            Assert.AreEqual(0, queue.Count);
        }
Esempio n. 4
0
        public void TestInitialize()
        {
            var queue = new TelemetryQueue();

            queue.Clear();
        }