Changeset 1680 for trunk/sources/HeuristicLab.Persistence
- Timestamp:
- 04/28/09 11:19:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs
r1679 r1680 38 38 } 39 39 40 public class EventTest { 41 public delegate object Filter(object o); 42 public event Filter OnChange; 43 [Storable] 44 private Delegate[] OnChangeListener { 45 get { return OnChange.GetInvocationList(); } 46 set { 47 foreach (Delegate d in value) { 48 OnChange += (Filter)d; 49 } 50 } 51 } 52 } 53 40 54 public class PrimitivesTest : NumberTest { 41 55 [Storable] … … 127 141 [TestCleanup()] 128 142 public void ClearTempFile() { 143 StreamReader reader = new StreamReader(tempFile); 144 string s = reader.ReadToEnd(); 145 reader.Close(); 129 146 File.Delete(tempFile); 130 147 } … … 389 406 } 390 407 408 [TestMethod] 409 public void Events() { 410 EventTest et = new EventTest(); 411 et.OnChange += (o) => o; 412 XmlGenerator.Serialize(et, tempFile); 413 EventTest newEt = (EventTest)XmlParser.DeSerialize(tempFile); 414 } 415 391 416 392 417 [ClassInitialize]
Note: See TracChangeset
for help on using the changeset viewer.