Changeset 12031 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Tests/HeuristicLab-3.3/ThreadSafeLogTest.cs
- Timestamp:
- 02/18/15 10:54:32 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Tests
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Tests/HeuristicLab-3.3/ThreadSafeLogTest.cs
r11171 r12031 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 [TestClass] 29 29 public class ThreadSafeLogTest { 30 31 30 [TestMethod] 32 31 [TestCategory("General")] … … 43 42 Assert.AreEqual(count, log.Messages.Count()); 44 43 } 44 45 [TestMethod] 46 [TestCategory("General")] 47 [TestProperty("Time", "short")] 48 public void ThreadSafeLogCapTest() { 49 int count = 10000; 50 int cap = 500; 51 ThreadSafeLog log = new ThreadSafeLog(cap); 52 53 Parallel.For(0, count, (i) => { 54 log.LogMessage("Message " + i); // write something 55 log.Messages.Count(); // iterate over all messages 56 }); 57 58 Assert.AreEqual(cap, log.Messages.Count()); 59 } 45 60 } 46 61 }
Note: See TracChangeset
for help on using the changeset viewer.