public void TestActorCollection() { TestLauncherActor.Test(() => { CollectionActor <string> collect = new CollectionActor <string>(); collect.Add("Test1"); collect.Add("Test2"); collect.Add("Test3"); Assert.IsTrue(collect.Any(t => t == "Test1")); Assert.IsTrue(collect.Contains("Test2")); Assert.IsTrue(collect.First(t => t == "Test3") != null); collect.Remove("Test1"); collect.Remove("Test2"); collect.Remove("Test3"); collect.Add("Test4"); collect.Add("Test5"); List <string> enumerable = collect.ToList(); Assert.AreEqual(2, enumerable.Count); }); }
public void TestActorCollection() { TestLauncherActor.Test(() => { var collect = new CollectionActor <string>(); collect.Add("Test1"); collect.Add("Test2"); collect.Add("Test3"); Assert.IsTrue(collect.Any(t => t == "Test1")); Assert.IsTrue(collect.Contains("Test2")); Assert.IsTrue(collect.Where(t => t == "Test3").First() != null); collect.Remove("Test1"); //Assert.IsFalse(collect.Exists("Test1").Result); collect.Remove("Test2"); //Assert.IsFalse(collect.Exists("Test2").Result); collect.Remove("Test3"); //Assert.IsFalse(collect.Exists("Test3").Result); collect.Add("Test4"); collect.Add("Test5"); var enumerable = collect.ToList(); Assert.AreEqual(2, enumerable.Count); }); }