public void ListMessage() { List <string> messages = new List <string> { "Привет", "Запрос", "Пока" }; StringBuilder expect = new StringBuilder(); foreach (string s in messages) { expect.AppendLine(s); } Notify += (string strok) => ProcessingMessage.AddMessage(strok); foreach (string s in messages) { Notify?.Invoke(s); } StringBuilder actual = ProcessingMessage.StringList(); Assert.AreEqual(expect.ToString(), actual.ToString()); }