Esempio n. 1
0
        public void ItReturnsTheNumberOfFailedMessages()
        {
            // Arrange
            const int FAILED_MESSAGES_COUNT = 5;

            this.SetupDeviceTelemetryActor();
            DeviceTelemetryActor.ActorEvents messageFailed = DeviceTelemetryActor.ActorEvents.TelemetrySendFailure;

            // Act
            for (int i = 0; i < FAILED_MESSAGES_COUNT; i++)
            {
                this.target.HandleEvent(messageFailed);
            }

            // Get results
            long failedMessagesCount = this.target.FailedMessagesCount;

            // Assert
            Assert.Equal(FAILED_MESSAGES_COUNT, failedMessagesCount);
        }
Esempio n. 2
0
        public void ItReturnsTheNumberOfTotalMessages()
        {
            // Arrange
            const int MESSAGES_SENDING_COUNT = 5;

            this.SetupDeviceTelemetryActor();
            DeviceTelemetryActor.ActorEvents sendingMessage = DeviceTelemetryActor.ActorEvents.SendingTelemetry;

            // Act
            for (int i = 0; i < MESSAGES_SENDING_COUNT; i++)
            {
                this.target.HandleEvent(sendingMessage);
            }

            // Get results
            long totalMessagesCount = this.target.TotalMessagesCount;

            // Assert
            Assert.Equal(MESSAGES_SENDING_COUNT, totalMessagesCount);
        }