Example #1
0
        public void ReturnZero_When_ListIsEmpty()
        {
            var emptyList = new List <LogEntry>();

            var count = EntryCounter.Count(emptyList);

            Assert.AreEqual(count, 0);
        }
Example #2
0
        static void Main(string[] args)
        {
            var logFile = new FileInfo("entrylog.txt");

            var log = LogParser.Parse(logFile);

            var count = EntryCounter.Count(log);

            System.Console.WriteLine(count);
        }
Example #3
0
        public void ReturnZero_When_ListIsntEmptyButContainsNoEntryBetween10HAnd16H()
        {
            var entry = new LogEntry(new DateTime(2019, 09, 01, 09, 00, 00), "Abertura da Porta OK");

            var entries = new List <LogEntry> {
                entry
            };

            var count = EntryCounter.Count(entries);

            Assert.AreEqual(count, 0);
        }
Example #4
0
        public void RaiseException_When_NullList()
        {
            List <LogEntry> nullEntries = null;

            Assert.Throws <NullReferenceException>(() => EntryCounter.Count(nullEntries));
        }