- Timestamp:
- 05/04/09 16:43:46 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs
r1705 r1733 172 172 [Storable] 173 173 public KeyValuePair<List<C>, C> kvpList; 174 } 175 176 public class NonSerializable { 177 int x; 174 178 } 175 179 … … 504 508 } 505 509 510 [TestMethod] 511 public void TestSavingException() { 512 List<int> list = new List<int> { 1, 2, 3 }; 513 XmlGenerator.Serialize(list, tempFile); 514 NonSerializable s = new NonSerializable(); 515 try { 516 XmlGenerator.Serialize(s, tempFile); 517 Assert.Fail("Exception expected"); 518 } catch (PersistenceException) { } 519 List<int> newList = (List<int>)XmlParser.DeSerialize(tempFile); 520 Assert.AreEqual(list[0], newList[0]); 521 Assert.AreEqual(list[1], newList[1]); 522 } 523 506 524 [ClassInitialize] 507 525 public static void Initialize(TestContext testContext) {
Note: See TracChangeset
for help on using the changeset viewer.