You've already forked linux-packaging-mono
Imported Upstream version 5.12.0.220
Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
parent
8bd104cef2
commit
8fc30896db
@ -29,6 +29,8 @@ using MonoTests.System.Threading.Tasks;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
using NUnit;
|
||||
using NUnit.Framework;
|
||||
@ -67,6 +69,7 @@ namespace MonoTests.System.Collections.Concurrent
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MultiThreaded")]
|
||||
public void AddParallelWithoutDuplicateTest ()
|
||||
{
|
||||
ParallelTestHelper.Repeat (delegate {
|
||||
@ -98,6 +101,7 @@ namespace MonoTests.System.Collections.Concurrent
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("MultiThreaded")]
|
||||
public void RemoveParallelTest ()
|
||||
{
|
||||
ParallelTestHelper.Repeat (delegate {
|
||||
@ -362,5 +366,20 @@ namespace MonoTests.System.Collections.Concurrent
|
||||
Assert.IsTrue (dict.Contains (validKeyPair));
|
||||
Assert.IsFalse (dict.Contains (wrongKeyPair));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SerializationRoundTrip ()
|
||||
{
|
||||
var bf = new BinaryFormatter();
|
||||
|
||||
var cd = new ConcurrentDictionary<int, int>();
|
||||
cd[0] = 42;
|
||||
var ms = new MemoryStream();
|
||||
bf.Serialize(ms, cd);
|
||||
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
var result = (ConcurrentDictionary<int, int>) bf.Deserialize(ms);
|
||||
Assert.AreEqual (42, result [0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user