Ejemplo n.º 1
0
        public IActionResult Get(string id)
        {
            int count = eventCounter.GetEventCount(id);

            if (count == -1)
            {
                return(NotFound());
            }

            return(Ok(count));
        }
Ejemplo n.º 2
0
        public void ParseEvents_LogWithEmptyLines_EmptyLinesIgnored()
        {
            eventCtr.ParseEvents("Device 1", GenerateStreamReader(
                                     new string[]
            {
                getLogLine("2001-01-01 19:46:00", 0),
                string.Empty,
                string.Empty,
                getLogLine("2001-01-01 19:50:00", 1)
            }));

            Assert.AreEqual(0, eventCtr.GetEventCount("Device 1"));
        }