コード例 #1
0
 public void TestToExpressionString()
 {
     _concatNode = new ExprConcatNode();
     _concatNode.AddChildNode(new SupportExprNode("a"));
     _concatNode.AddChildNode(new SupportExprNode("b"));
     Assert.AreEqual("\"a\"||\"b\"", _concatNode.ToExpressionStringMinPrecedenceSafe());
     _concatNode.AddChildNode(new SupportExprNode("c"));
     Assert.AreEqual("\"a\"||\"b\"||\"c\"", _concatNode.ToExpressionStringMinPrecedenceSafe());
 }
コード例 #2
0
        private void runAssertionThreading(ConfigurationEngineDefaults.ThreadingProfile threadingProfile)
        {
            _concatNode = new ExprConcatNode();
            var textA = "This is the first text";
            var textB = "Second text";
            var textC = "Third text, some more";

            foreach (var text in new[] { textA, textB, textC })
            {
                _concatNode.AddChildNode(new ExprConstantNodeImpl(text));
            }
            _concatNode.Validate(SupportExprValidationContextFactory.MakeEmpty(_container, threadingProfile));

            var numThreads = 4;
            var numLoop    = 10000;

            var threads = new List <SupportConcatThread>(numThreads);

            for (var i = 0; i < numThreads; i++)
            {
                var thread = new SupportConcatThread(_concatNode, numLoop, textA + textB + textC);
                threads.Add(thread);
                thread.Start();
            }

            foreach (var thread in threads)
            {
                thread.Join();
                Assert.IsFalse(thread.IsFail);
            }
        }