Пример #1
0
        private Task <bool> RunAsyncForListenerRegular(int i, string typed)
        {
            int    param = i;
            string type  = typed;
            var    t     = Task.Run <bool>(() =>
            {
                bool check            = true;
                FunctionContext fctx1 = null;
                try
                {
                    System.Diagnostics.Debug.WriteLine($"Calling {param} Typed TESTMULTI{type}");
                    fctx1 = new FunctionContext($"TESTMULTI{type}");
                    fctx1.AddParam("test", param);
                    var rets = vlr.mmc.DispatchToListeners(fctx1);

                    foreach (var ret in rets.Values)
                    {
                        var myvalue = (int)ret;
                        System.Diagnostics.Debug.WriteLine(param + "*************************" + myvalue);
                        //Assert.IsTrue(myvalue == param);
                        check = check && (myvalue == param);
                    }
                }
                catch (Exception e)
                {
                    //Assert.IsTrue(e.Message.CompareTo($"Error {fctx1.type} {param}") == 0);
                    check = check && (e.Message == $"Error {fctx1.type} {param}");
                }
                return(check);
            });

            return(t);
        }