- Timestamp:
- 10/03/11 18:34:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab/3.3/Tests/ThreadSafeLogTest.cs
r6551 r6862 20 20 #endregion 21 21 22 using System; 22 23 using System.Linq; 23 24 using System.Threading.Tasks; 25 using HeuristicLab.Common; 24 26 using HeuristicLab.Core; 25 27 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 41 43 Assert.AreEqual(count, log.Messages.Count()); 42 44 } 45 46 private ThreadSafeLog recursionInLogViewTestLog; 47 [TestMethod] 48 public void ThreadSafeLogRecursionInLogViewTest() { 49 int count = 10; 50 recursionInLogViewTestLog = new ThreadSafeLog(); 51 recursionInLogViewTestLog.MessageAdded += new EventHandler<EventArgs<string>>(log_MessageAdded); 52 53 for (int i = 0; i < count; i++) { 54 recursionInLogViewTestLog.LogMessage("Message " + i); 55 } 56 } 57 void log_MessageAdded(object sender, EventArgs<string> e) { 58 //access Messages like LogView does 59 Console.WriteLine(string.Join(Environment.NewLine, recursionInLogViewTestLog.Messages.ToArray())); 60 } 43 61 } 44 62 }
Note: See TracChangeset
for help on using the changeset viewer.