コード例 #1
0
        public void ShouldAddNewLine_When_ThereIsCapacity()
        {
            const string newLine = "test";
            var container = new LogsLineContainer(3);

            container.Add(newLine);

            Assert.That(container.Lines.Count(), Is.EqualTo(1));
            Assert.That(container.Lines.ElementAt(0), Is.EqualTo(newLine));
        }
コード例 #2
0
        public void Text_Should_ReturnJoinedLines()
        {
            var container = new LogsLineContainer();

            container.Add("A");
            container.Add("B");
            container.Add("C");

            Assert.That(container.Text,Is.EqualTo("A\r\nB\r\nC"));
        }
コード例 #3
0
        public void ShouldAddNewLine_And_RemoveFirstOne_When_ThereIsEnoughCapacity()
        {
            const string newLine = "test";
            var container = new LogsLineContainer(2);

            container.Add("A");
            container.Add("B");
            container.Add(newLine);

            Assert.That(container.Lines.ElementAt(0), Is.EqualTo("B"));
            Assert.That(container.Lines.ElementAt(1), Is.EqualTo(newLine));
        }
コード例 #4
0
 public UnityLogger()
 {
     _logsLineContainer = new LogsLineContainer();
 }