public void ParserServerTest() { ParserServer parser = new ParserServer(); TestParserActor receive = new TestParserActor(); TestLauncherActor.Test(() => { parser.SendMessage((IActor)receive, "A B C D E"); var result = receive.GetList().Result; Assert.IsTrue(result.Any()); Assert.IsTrue(result.Count() == 5); Assert.IsTrue(result.Count(c => c == "C") == 1); }); }
public void ReceiveLineTest() { BehaviorReceiveLine brl = new BehaviorReceiveLine(); TestParserActor receive = new TestParserActor(); string testLine = "A B CD E F"; IMessageParam <IActor, string> msg = new MessageParam <IActor, string>(receive, testLine); TestLauncherActor.Test(() => { // call behavior directly if (brl.DefaultPattern()(msg.Item1, msg.Item2)) { brl.StandardApply(msg); var result = receive.GetList().Result; Assert.IsTrue(result.Any()); Assert.IsTrue(result.Count() == 5); Assert.IsTrue(result.Count(c => c == "CD") == 1); } }); }