Exemplo n.º 1
0
        public void LogsCollectionIsCollection()
        {
            LogsCollection logsCollection = new LogsCollection();

            logsCollection.Add(new Entry("log1"));
            logsCollection.Add(new Entry("log2", new DateTime(2019, 6, 7, 5, 0, 32)));

            Assert.AreEqual(2, logsCollection.Count());
        }
Exemplo n.º 2
0
        public void LogsCollectionCountOfContains()
        {
            LogsCollection logsCollection = new LogsCollection();

            for (int i = 0; i < 10; ++i)
            {
                logsCollection.Add(new Entry("log" + i.ToString()));
                if (i % 2 == 0)
                {
                    logsCollection.Add(new Entry("Log" + i.ToString() + ".2"));
                    logsCollection.Add(new Entry("lo" + i.ToString() + "g"));
                }
            }

            Assert.AreEqual(20, logsCollection.Count());
            Assert.AreEqual(15, logsCollection.CountOfContains("log"));
            Assert.AreEqual(10, logsCollection.CountOfContains("log", true));
        }