Exemplo n.º 1
0
        public void eventCounter_Returns2_whenFileContainsTwoFaults()
        {
            // Arrange
            var eventCounter = new EventCounter();

            // Act
            eventCounter.ParseEvents("3", EventLog3);

            // Verify / Assert
            var eventCounts = JsonConvert.DeserializeObject <List <EventCount> >(eventCounter.GetEventCounts());

            Assert.AreEqual(eventCounts.First().eventCount, 2);
        }
Exemplo n.º 2
0
        public void eventCounter_Returns0_whenFileDoesNotContainAnyFault()
        {
            // Arrange
            var eventCounter = new EventCounter();

            // Act
            eventCounter.ParseEvents("4", EventLog4);

            // Verify / Assert
            var eventCounts = JsonConvert.DeserializeObject <List <EventCount> >(eventCounter.GetEventCounts());

            Assert.AreEqual(eventCounts.First().eventCount, 0);
        }
Exemplo n.º 3
0
        public void eventCounter_Returns1_whenFileContainsSingleFaultWithRedundantStages()
        {
            // Arrange
            var eventCounter = new EventCounter();

            // Act
            eventCounter.ParseEvents("2", EventLog2);

            // Verify / Assert
            var eventCounts = JsonConvert.DeserializeObject <List <EventCount> >(eventCounter.GetEventCounts());

            Assert.AreEqual(eventCounts.First().eventCount, 1);
        }