예제 #1
0
 public void DictionaryActorTest()
 {
     TestLauncherActor.Test(() =>
     {
         var act = new DictionaryActor <string, int>();
         Assert.IsNotNull(act);
     });
 }
예제 #2
0
 public void AddKVTest()
 {
     TestLauncherActor.Test(() =>
     {
         var act = new DictionaryActor <string, int>();
         Assert.IsNotNull(act);
         act.AddKeyValue("1", 1);
         act.AddKeyValue("2", 2);
     });
 }
예제 #3
0
 public void RemoveKTest()
 {
     TestLauncherActor.Test(() =>
     {
         var act = new DictionaryActor <string, int>();
         Assert.IsNotNull(act);
         act.AddKeyValue("1", 1);
         act.AddKeyValue("2", 2);
         act.RemoveKey("1");
         var r1 = act.GetKeyValue("2");
         Assert.AreEqual(2, r1.Result().Item3);
     });
 }
예제 #4
0
 public void AsEnumerableTest()
 {
     TestLauncherActor.Test(() =>
     {
         var act = new DictionaryActor <string, int>();
         Assert.IsNotNull(act);
         act.AddKeyValue("1", 1);
         act.AddKeyValue("2", 2);
         act.AddKeyValue("3", 3);
         act.AddKeyValue("4", 4);
         var future = act.AsEnumerable();
         var result = future.Result();
         var first  = result.First();
         Assert.AreEqual("[1, 1]", first.ToString());
     });
 }
예제 #5
0
 public void ClearTest()
 {
     TestLauncherActor.Test(() =>
     {
         var act = new DictionaryActor <string, int>();
         Assert.IsNotNull(act);
         act.AddKeyValue("1", 1);
         act.AddKeyValue("2", 2);
         act.AddKeyValue("3", 3);
         act.AddKeyValue("4", 4);
         var future = act.GetKeyValue("1");
         var result = future.Result();
         Assert.IsTrue(result.Item1);
         Assert.AreEqual(1, result.Item3);
         act.Clear();
         var nofuture = act.GetKeyValue("1");
         Assert.IsFalse(nofuture.Result().Item1);
     });
 }
예제 #6
0
 public void GetKeyValueTest()
 {
     TestLauncherActor.Test(() =>
     {
         var act = new DictionaryActor <string, int>();
         Assert.IsNotNull(act);
         act.AddKeyValue("1", 1);
         act.AddKeyValue("2", 2);
         var r1 = act.GetKeyValue("1");
         var r2 = act.GetKeyValue("2");
         var r3 = act.GetKeyValue("3");
         var f1 = r1.Result();
         var f2 = r2.Result();
         Assert.IsTrue(f1.Item1);
         Assert.IsTrue(f2.Item1);
         Assert.AreEqual("2", f2.Item2);
         Assert.AreEqual(2, f2.Item3);
         Assert.IsFalse(r3.Result().Item1);
     });
 }