- Timestamp:
- 06/07/11 12:49:03 (13 years ago)
- Location:
- branches/GP.Grammar.Editor/HeuristicLab.Persistence/3.3/Tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Persistence/3.3/Tests/HeuristicLab.Persistence-3.3.Tests.csproj
r4065 r6377 107 107 </ItemGroup> 108 108 <ItemGroup> 109 <ProjectReference Include="..\..\..\HeuristicLab.Algorithms.GeneticAlgorithm\3.3\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj"> 110 <Project>{A51DA44F-CB35-4F6F-99F5-2A2E904AB93B}</Project> 111 <Name>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</Name> 112 </ProjectReference> 109 113 <ProjectReference Include="..\HeuristicLab.Persistence-3.3.csproj"> 110 114 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> -
branches/GP.Grammar.Editor/HeuristicLab.Persistence/3.3/Tests/UseCases.cs
r5698 r6377 39 39 using HeuristicLab.Persistence.Interfaces; 40 40 using Microsoft.VisualStudio.TestTools.UnitTesting; 41 using System.Threading.Tasks; 42 using HeuristicLab.Algorithms.GeneticAlgorithm; 41 43 42 44 namespace HeuristicLab.Persistence_33.Tests { … … 1198 1200 public OneWayTest() { this.value = "default"; } 1199 1201 public string value; 1200 [Storable(AllowOneWay =true)]1202 [Storable(AllowOneWay = true)] 1201 1203 public string ReadOnly { 1202 1204 get { return "ReadOnly"; } 1203 1205 } 1204 [Storable(AllowOneWay =true)]1206 [Storable(AllowOneWay = true)] 1205 1207 public string WriteOnly { 1206 1208 set { this.value = value; } … … 1255 1257 } 1256 1258 1257 1259 [TestMethod] 1260 public void FontTest() { 1261 List<Font> fonts = new List<Font>() { 1262 new Font(FontFamily.GenericSansSerif, 12), 1263 new Font("Times New Roman", 21, FontStyle.Bold, GraphicsUnit.Pixel), 1264 new Font("Courier New", 10, FontStyle.Underline, GraphicsUnit.Document), 1265 new Font("Helvetica", 21, FontStyle.Strikeout, GraphicsUnit.Inch, 0, true), 1266 }; 1267 XmlGenerator.Serialize(fonts, tempFile); 1268 var newFonts = XmlParser.Deserialize<List<Font>>(tempFile); 1269 Assert.AreEqual(fonts[0], newFonts[0]); 1270 Assert.AreEqual(fonts[1], newFonts[1]); 1271 Assert.AreEqual(fonts[2], newFonts[2]); 1272 Assert.AreEqual(fonts[3], newFonts[3]); 1273 } 1274 1275 [TestMethod] 1276 public void ConcurrencyTest() { 1277 int n = 20; 1278 Task[] tasks = new Task[n]; 1279 for (int i = 0; i < n; i++) { 1280 tasks[i] = Task.Factory.StartNew((idx) => { 1281 byte[] data; 1282 using(var stream = new MemoryStream()) { 1283 XmlGenerator.Serialize(new GeneticAlgorithm(), stream); 1284 data = stream.ToArray(); 1285 } 1286 }, i); 1287 } 1288 Task.WaitAll(tasks); 1289 } 1258 1290 1259 1291 [ClassInitialize]
Note: See TracChangeset
for help on using the changeset viewer.