Exemplo n.º 1
0
 public void TestRemove()
 {
     serverSyncList.Remove("World");
     SerializeHelper.SerializeDeltaTo(serverSyncList, clientSyncList);
     Assert.That(clientSyncList, Is.EquivalentTo(new[] { "Hello", "!" }));
 }
Exemplo n.º 2
0
 public void TestInsertRange()
 {
     serverSyncList.InsertRange(1, new[] { "One", "Two", "Three" });
     SerializeHelper.SerializeDeltaTo(serverSyncList, clientSyncList);
     Assert.That(clientSyncList, Is.EqualTo(new[] { "Hello", "One", "Two", "Three", "World", "!" }));
 }
Exemplo n.º 3
0
 public void TestRemoveAll()
 {
     serverSyncList.RemoveAll(entry => entry.Contains("l"));
     SerializeHelper.SerializeDeltaTo(serverSyncList, clientSyncList);
     Assert.That(clientSyncList, Is.EquivalentTo(new[] { "!" }));
 }
Exemplo n.º 4
0
 public void TestClear()
 {
     serverSyncList.Clear();
     SerializeHelper.SerializeDeltaTo(serverSyncList, clientSyncList);
     Assert.That(clientSyncList, Is.EquivalentTo(new string[] { }));
 }
Exemplo n.º 5
0
 public void TestInsert()
 {
     serverSyncList.Insert(0, "yay");
     SerializeHelper.SerializeDeltaTo(serverSyncList, clientSyncList);
     Assert.That(clientSyncList, Is.EquivalentTo(new[] { "yay", "Hello", "World", "!" }));
 }
Exemplo n.º 6
0
 public void TestUnionWithSelf()
 {
     serverSyncSet.UnionWith(serverSyncSet);
     SerializeHelper.SerializeDeltaTo(serverSyncSet, clientSyncSet);
     Assert.That(clientSyncSet, Is.EquivalentTo(new[] { "World", "Hello", "!" }));
 }
Exemplo n.º 7
0
 public void TestSymmetricExceptWithSelf()
 {
     serverSyncSet.SymmetricExceptWith(serverSyncSet);
     SerializeHelper.SerializeDeltaTo(serverSyncSet, clientSyncSet);
     Assert.That(clientSyncSet, Is.EquivalentTo(new string[] { }));
 }
Exemplo n.º 8
0
 public void TestIntersectWith()
 {
     serverSyncSet.IntersectWith(new[] { "World", "Hello" });
     SerializeHelper.SerializeDeltaTo(serverSyncSet, clientSyncSet);
     Assert.That(clientSyncSet, Is.EquivalentTo(new[] { "World", "Hello" }));
 }
Exemplo n.º 9
0
 public void TestClear()
 {
     serverSyncDictionary.Clear();
     SerializeHelper.SerializeDeltaTo(serverSyncDictionary, clientSyncDictionary);
     Assert.That(serverSyncDictionary, Is.EquivalentTo(new SyncDictionaryIntString()));
 }
Exemplo n.º 10
0
 public void TestRemove()
 {
     serverSyncDictionary.Remove(1);
     SerializeHelper.SerializeDeltaTo(serverSyncDictionary, clientSyncDictionary);
     Assert.That(!clientSyncDictionary.ContainsKey(1));
 }