Пример #1
0
        public Responser GetInfoByID([FromBody] AM_PayRollInfo payRollInfo)
        {
            try
            {
                PayRollDB = new PayRollDB_();

                responser_ = this.ValidateAuthorization(payRollInfo.Token.ToString());

                if (responser_.Data.Get <bool>())
                {
                    responser_.Data          = PayRollDB.PayRollInfo_Tab.ToList().MapTo <PayRollInfo_Tab, AM_PayRollInfo>().Where(item => item.EmployeeID.ToString() == payRollInfo.PayRollInfoID.ToString()).ToList().FirstOrDefault();
                    responser_.Status        = 0;
                    responser_.StatusMessage = "Operation Get successfully";
                }

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Data          = null;
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();

                return(responser_);
            }
        }
Пример #2
0
        public Responser GetAll([FromBody] AM_Employee employee)
        {
            try
            {
                PayRollDB = new PayRollDB_();

                responser_ = this.ValidateAuthorization(employee.Token.ToString());

                if (responser_.Data.Get <bool>())
                {
                    responser_.Data          = PayRollDB.Employees_Tab.ToList().MapTo <Employees_Tab, AM_Employee>().ToList();
                    responser_.Status        = 0;
                    responser_.StatusMessage = "Operation Get successfully";
                }

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Data          = null;
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();

                return(responser_);
            }
        }
        public void RegisterUnregister()
        {
            // Registering / unregistering in service.
            Responser.RegisterRequestMessageReceiver <int>((x, y) => { });
            Responser.RegisterRequestMessageReceiver <CustomClass>((x, y) => { });
            Responser.RegisterRequestMessageReceiver <string>((x, y) => { });

            Assert.AreEqual(3, Responser.RegisteredRequestMessageTypes.Count());
            Assert.IsTrue(Responser.RegisteredRequestMessageTypes.Any(x => x == typeof(int)));
            Assert.IsTrue(Responser.RegisteredRequestMessageTypes.Any(x => x == typeof(CustomClass)));
            Assert.IsTrue(Responser.RegisteredRequestMessageTypes.Any(x => x == typeof(string)));

            Responser.UnregisterRequestMessageReceiver <CustomClass>();

            Assert.AreEqual(2, Responser.RegisteredRequestMessageTypes.Count());
            Assert.IsTrue(Responser.RegisteredRequestMessageTypes.Any(x => x == typeof(int)));
            Assert.IsTrue(Responser.RegisteredRequestMessageTypes.Any(x => x == typeof(string)));


            // Registering / unregistering in client.
            Requester.RegisterResponseMessageReceiver <int>((x, y) => { });
            Requester.RegisterResponseMessageReceiver <CustomClass>((x, y) => { });
            Requester.RegisterResponseMessageReceiver <string>((x, y) => { });

            Assert.AreEqual(3, Requester.RegisteredResponseMessageTypes.Count());
            Assert.IsTrue(Requester.RegisteredResponseMessageTypes.Any(x => x == typeof(int)));
            Assert.IsTrue(Requester.RegisteredResponseMessageTypes.Any(x => x == typeof(CustomClass)));
            Assert.IsTrue(Requester.RegisteredResponseMessageTypes.Any(x => x == typeof(string)));

            Requester.UnregisterResponseMessageReceiver <int>();

            Assert.AreEqual(2, Requester.RegisteredResponseMessageTypes.Count());
            Assert.IsTrue(Requester.RegisteredResponseMessageTypes.Any(x => x == typeof(CustomClass)));
            Assert.IsTrue(Requester.RegisteredResponseMessageTypes.Any(x => x == typeof(string)));
        }
Пример #4
0
 private void RefreshPage()
 {
     if (Request.QueryString["vid"] != null)
     {
         string vid = Request.QueryString["vid"];
         vid1.Src             = DAL.DataAccessLayer.GetVideo(vid).Url;
         Responser.DataSource = DAL.DataAccessLayer.GetMyVideoResponses(vid);
         Responser.DataBind();
     }
 }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="stream"></param>
        public void OnResponse(uint id, MemoryStream stream)
        {
            Responser responser = null;

            if (ResponserList.TryGetValue(id, out responser))
            {
                responser(stream);
            }
            else
            {
                LOG.Warn("{0} get battle {1} subId {2} unsupported package id {3}", Api.ServerName, MainId, SubId, id);
            }
        }
Пример #6
0
        public void Response(uint id, MemoryStream stream)
        {
            Responser responser = null;

            if (_responsers.TryGetValue(id, out responser))
            {
                responser(stream);
            }
            else
            {
                Console.WriteLine("got unsupported packet {0}", id);
            }
        }
Пример #7
0
        /// <summary>
        /// Updates an employee within Employee PayRoll
        /// </summary>
        /// <param name="employee">Employee Model</param>
        /// <returns></returns>
        public Responser Put([FromBody] AM_Employee employee)
        {
            try
            {
                PayRollDB = new PayRollDB_();

                responser_ = this.ValidateAuthorization(employee.Token.ToString());

                if (responser_.Data.Get <bool>())
                {
                    Employees_Tab employees = PayRollDB.Employees_Tab.Where(bt => bt.EmployeeID == employee.EmployeeID).FirstOrDefault();

                    if (employees != null)
                    {
                        employees.Name          = employee.Name;
                        employees.LastNames     = employee.LastNames;
                        employees.Email         = employee.Email;
                        employees.Password      = employee.Password;
                        employees.RoleID        = employee.RoleID;
                        employees.Active        = employee.Active;
                        employees.AdmissionDate = DateTime.Now;

                        PayRollDB.Employees_Tab.Add(employees);
                        PayRollDB.SaveChanges();

                        string lastInserted = PayRollDB.Employees_Tab.OrderByDescending(bt => bt.EmployeeID).Take(1).Select(bt => bt.EmployeeID).FirstOrDefault().ToString();

                        responser_.Data          = lastInserted;
                        responser_.StatusMessage = "Operation Put for Employee successfully.";
                    }
                }
                else
                {
                    responser_.Data          = employee.EmployeeID;
                    responser_.StatusMessage = "Employee ID not found: Operation Put for Employee successfully.";
                }

                responser_.Status = 0;

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Data          = null;
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();

                return(responser_);
            }
        }
Пример #8
0
        public void OnResponse(MemoryStream stream, uint msgId)//,int uid)
        {
            Responser responser = null;

            if (responsers.TryGetValue(msgId, out responser))
            {
                //Log.Warn("got package id 0x{0}", Convert.ToString(msgId,16));
                // Log.Warn("got package id 0x{0:x}", msgId);
                responser(stream);
            }
            else
            {
                //Log.Warn("got unsupported package id 0x{0:x}", msgId);
            }
        }
Пример #9
0
        public void SendReceive_1Message()
        {
            // The test can be performed from more thread therefore we must synchronize.
            AutoResetEvent aMessageReceivedEvent = new AutoResetEvent(false);

            int aReceivedMessage = 0;

            Responser.MessageReceived += (x, y) =>
            {
                aReceivedMessage = y.RequestMessage;

                // Send the response
                Responser.SendResponseMessage(y.ResponseReceiverId, 1000);
            };


            int aReceivedResponse = 0;

            Requester.ResponseReceived += (x, y) =>
            {
                aReceivedResponse = y.ResponseMessage;

                // Signal that the response message was received -> the loop is closed.
                aMessageReceivedEvent.Set();
            };


            try
            {
                Responser.AttachDuplexInputChannel(DuplexInputChannel);
                Requester.AttachDuplexOutputChannel(DuplexOutputChannel);

                Requester.SendRequestMessage(2000);

                // Wait for the signal that the message is received.
                aMessageReceivedEvent.WaitOne();
                //Assert.IsTrue(aMessageReceivedEvent.WaitOne(2000));
            }
            finally
            {
                Requester.DetachDuplexOutputChannel();
                Responser.DetachDuplexInputChannel();
            }

            // Check received values
            Assert.AreEqual(2000, aReceivedMessage);
            Assert.AreEqual(1000, aReceivedResponse);
        }
        public void SendReceive_NullMessage()
        {
            // The test can be performed from more threads therefore we must synchronize.
            AutoResetEvent aMessageReceivedEvent = new AutoResetEvent(false);

            CustomClass aReceivedMessage2 = null;

            Responser.RegisterRequestMessageReceiver <CustomClass>((x, y) =>
            {
                aReceivedMessage2 = y.RequestMessage;

                Responser.SendResponseMessage <CustomClass>(y.ResponseReceiverId, null);
            });


            Responser.AttachDuplexInputChannel(DuplexInputChannel);

            CustomClass aReceivedResponse2 = new CustomClass();

            Requester.RegisterResponseMessageReceiver <CustomClass>((x, y) =>
            {
                aReceivedResponse2 = y.ResponseMessage;

                // Signal that the response message was received -> the loop is closed.
                aMessageReceivedEvent.Set();
            });
            Requester.AttachDuplexOutputChannel(DuplexOutputChannel);

            try
            {
                Requester.SendRequestMessage <int>(1000);

                Requester.SendRequestMessage <CustomClass>(null);

                // Wait for the signal that the message is received.
                aMessageReceivedEvent.WaitOne();
                //Assert.IsTrue(aMessageReceivedEvent.WaitOne(2000));
            }
            finally
            {
                Requester.DetachDuplexOutputChannel();
                Responser.DetachDuplexInputChannel();
            }

            // Check received values
            Assert.IsNull(aReceivedMessage2);
            Assert.IsNull(aReceivedResponse2);
        }
        /// <summary>
        /// Analyse message and get response from bot
        /// </summary>
        /// <param name="message"></param>
        /// <returns>Response from bot</returns>
        public string GetResponseFromBot(string message)
        {
            Logger.log.Debug("at BusinessLogicTier.Providers.GetREsponseFromBot");
            var commandParser = new CommandParser();
            var manager       = new CommandManager();
            var data          = commandParser.ParseMessage(message);

            var response = new Responser(commandParser.Commands, commandParser.ExceptionCommands);

            response.CreateMessage(commandParser.SplittedMessage);

            var listWithAnswers = new List <string>();

            foreach (var temp in data)
            {
                foreach (var arg in temp.Value)
                {
                    var result = manager.Execute(temp.Key, arg);

                    if (commandParser.ExceptionCommands.Contains(temp.Key))
                    {
                        response.SetResultInsteadCommand(temp.Key, result);
                    }
                    else
                    {
                        listWithAnswers.Add(result);
                    }
                }
            }

            var wcm   = new WithoutCommandManager(commandParser.ExceptionCommands);
            var data2 = wcm.FindExpressions(response.Response);

            foreach (var temp in data2)
            {
                foreach (var arg in temp.Value)
                {
                    var result = manager.Execute(temp.Key, arg);
                    response.SetResultInsteadWithoutCommand(arg, result);
                }
            }

            var returnResult = listWithAnswers.Aggregate((a, b) => a + "\n\n" + b) + "\n\n" + response.Response;

            return(returnResult);
        }
Пример #12
0
        public SockMgr(SockBase sockBase, Protocol.IProtocolFactory protocolFactory)
        {
            _sockBase = sockBase;
            _sockBase.SocketReceiveEvent       += OnSocketReceive;
            _sockBase.SocketShutdownBeginEvent += OnSocketShutdownBegin;

            protocolFactory.SetSockMgr(this);  // TODO: review
            _protocolFactory = protocolFactory;

            if (sockBase.Role == SocketRole.Client)  // listener does not need to send or receive
            {
                _protocolStack = protocolFactory.GetProtocolStack();
            }

            Responser responser = new Responser(_protocolStack, this);

            _responser = responser;
        }
Пример #13
0
        /// <summary>
        /// Updates a PayRollInfo for an employee within Employee PayRoll
        /// </summary>
        /// <param name="payRollInfo_">PayRollInfo to add to current Employee</param>
        /// <returns></returns>
        public Responser Put([FromBody] AM_PayRollInfo payRollInfo_)
        {
            try
            {
                PayRollDB = new PayRollDB_();

                responser_ = this.ValidateAuthorization(payRollInfo_.Token.ToString());

                if (responser_.Data.Get <bool>())
                {
                    PayRollInfo_Tab payRollInfo = PayRollDB.PayRollInfo_Tab.Where(bt => bt.EmployeeID == payRollInfo_.EmployeeID).FirstOrDefault();

                    if (payRollInfo != null)
                    {
                        payRollInfo.BaseSalary         = payRollInfo_.BaseSalary;
                        payRollInfo.BreakfastDeduction = payRollInfo_.BreakfastDeduction;
                        payRollInfo.SavingDeduction    = payRollInfo_.SavingDeduction;
                        PayRollDB.SaveChanges();

                        responser_.StatusMessage = "Operation Put for PayRollInfo successfully.";
                        responser_.Data          = payRollInfo_.PayRollInfoID;
                    }
                    else
                    {
                        responser_.StatusMessage = "PayRollInfo not found: Operation Put for PayRollInfo Failed.";
                        responser_.Data          = payRollInfo_.PayRollInfoID;
                    }

                    responser_.Status = 0;
                }

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Data          = null;
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();

                return(responser_);
            }
        }
Пример #14
0
        /// <summary>
        /// Deletes an employee within Employee PayRoll
        /// </summary>
        /// <param name="employee">Employee Model</param>
        /// <returns></returns>
        public Responser Delete([FromBody] AM_Employee employee)
        {
            try
            {
                PayRollDB = new PayRollDB_();

                responser_ = this.ValidateAuthorization(employee.Token.ToString());

                if (responser_.Data.Get <bool>())
                {
                    Employees_Tab employees = PayRollDB.Employees_Tab.Where(bt => bt.EmployeeID == employee.EmployeeID).FirstOrDefault();

                    if (employees != null)
                    {
                        PayRollDB.Employees_Tab.Remove(employees);
                        PayRollDB.SaveChanges();

                        responser_.Data          = employee.EmployeeID;
                        responser_.StatusMessage = "Operation Delete for Employee successfully.";
                    }
                }
                else
                {
                    responser_.Data          = employee.EmployeeID;
                    responser_.StatusMessage = "Employee ID not found: Operation Delete for Employee successfully.";
                }

                responser_.Status = 0;

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Data          = null;
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();

                return(responser_);
            }
        }
Пример #15
0
        /// <summary>
        /// Adds a PayRollInfo for an employee within Employee PayRoll
        /// </summary>
        /// <param name="payRollInfo_">PayRollInfo to add to current Employee</param>
        /// <returns></returns>
        public Responser Post([FromBody] AM_PayRollInfo payRollInfo_)
        {
            try
            {
                PayRollDB = new PayRollDB_();

                responser_ = this.ValidateAuthorization(payRollInfo_.Token.ToString());

                if (responser_.Data.Get <bool>())
                {
                    PayRollInfo_Tab payRollInfo = new PayRollInfo_Tab();
                    payRollInfo.EmployeeID         = payRollInfo_.EmployeeID;
                    payRollInfo.BaseSalary         = payRollInfo_.BaseSalary;
                    payRollInfo.BreakfastDeduction = payRollInfo_.BreakfastDeduction;
                    payRollInfo.SavingDeduction    = payRollInfo_.SavingDeduction;
                    payRollInfo.CreationDate       = DateTime.Now;
                    payRollInfo.Active             = payRollInfo_.Active;

                    PayRollDB.PayRollInfo_Tab.Add(payRollInfo);
                    PayRollDB.SaveChanges();

                    string lastInserted = PayRollDB.PayRollInfo_Tab.OrderByDescending(bt => bt.PayRollInfoID).Take(1).Select(bt => bt.PayRollInfoID).FirstOrDefault().ToString();

                    responser_.Data          = lastInserted;
                    responser_.Status        = 0;
                    responser_.StatusMessage = "Operation Post for PayRollInfo successfully.";
                }

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Data          = null;
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();

                return(responser_);
            }
        }
Пример #16
0
        public Responser LogOff(string id = "")
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(id))
                {
                    List <AM_Employee> employees = PayRollDB.Employees_Tab.ToList().MapTo <Employees_Tab, AM_Employee>();

                    employees = employees.Where(item => item.EmployeeID == int.Parse(id)).ToList();

                    if (employees.Count > 0)
                    {
                        //Get logged user
                        AM_Employee employee = employees.FirstOrDefault();

                        //Disable Token
                        AuthController authController = new AuthController();
                        responser_ = authController.DisableTokenAuth(employee.EmployeeID.ToString());
                    }
                    else
                    {
                        responser_.Status        = -2;
                        responser_.StatusMessage = "LogOff failed";
                        responser_.Data          = null;
                    }
                }

                return(responser_);
            }
            catch (Exception e)
            {
                responser_.Status        = -1;
                responser_.StatusMessage = e.Message.ToString();
                responser_.Data          = null;

                return(responser_);
            }
        }
Пример #17
0
        public IActionResult Callback([FromBody] Updates updates)
        {
            #region hide
            //switch (updates.GroupId)
            //{
            //    //// GROUP_TEST
            //    //case 178202369:
            //    //    switch (updates.Type)
            //    //    {
            //    //        case "confirmation":
            //    //            return Ok(_configuration["ConfigTEST:Confirmation"]);

            //    //        case "message_new":
            //    //            var msg = Message.FromJson(new VkResponse(updates.Object));
            //    //            _controllerDebug.LogInformation($"Got message. PeerID:{msg.PeerId}, UserID:{msg.UserId}, Text:{msg.Text}");
            //    //            MessagesSendParams response = IPRResponser.ConstructResponse(msg);
            //    //            VkControllers.TEST_API.Messages.Send(response);
            //    //            break;
            //    //    }
            //    //    break;

            //    // IPD
            //    case 185277791:
            //        switch (updates.Type)
            //        {
            //            case "confirmation":
            //                return Ok(_configuration["ConfigIPD:Confirmation"]);

            //            case "message_new":
            //                var msg = Message.FromJson(new VkResponse(updates.Object));
            //                _controllerDebug.LogInformation($"Got message. PeerID:{msg.PeerId}, UserID:{msg.UserId}, Text:{msg.Text}");
            //                MessagesSendParams response = IPDResponser.ConstructResponse(msg);
            //                VkControllers.IPDApi.Messages.Send(response);
            //                break;
            //        }
            //        break;

            //    // IPR
            //    case 170670736:
            //        switch (updates.Type)
            //        {
            //            case "confirmation":
            //                return Ok(_configuration["ConfigIPR:Confirmation"]);

            //            case "message_new":
            //                var msg = Message.FromJson(new VkResponse(updates.Object));
            //                _controllerDebug.LogInformation($"Got message. PeerID:{msg.PeerId}, UserID:{msg.UserId}, Text:{msg.Text}");
            //                MessagesSendParams response = IPRResponser.ConstructResponse(msg);
            //                VkControllers.IPRApi.Messages.Send(response);
            //                break;
            //        }
            //        break;
            //}
            //// Возвращаем "ok" серверу Callback API
            //return Ok("ok");
            #endregion

            Responser currentResponser = BotMain.Responsers[updates.GroupId];

            switch (updates.Type)
            {
            case "confirmation":
                return(Ok(currentResponser.Confirmation));

            case "message_new":
                var msg = Message.FromJson(new VkResponse(updates.Object));

                _controllerDebug.LogInformation($"Got message. PeerID:{msg.PeerId}, UserID:{msg.UserId}, Text:{msg.Text}");

                MessagesSendParams response = currentResponser.ConstructResponse(msg);
                currentResponser.VkController.Messages.Send(response);
                break;
            }

            return(Ok("ok"));
        }
Пример #18
0
 public void AddResponser(uint id, Responser responser)
 {
     responsers.Add(id, responser);
 }
        public void SendReceive_Message()
        {
            // The test can be performed from more threads therefore we must synchronize.
            AutoResetEvent aMessageReceivedEvent = new AutoResetEvent(false);

            int aReceivedMessage1 = 0;

            Responser.RegisterRequestMessageReceiver <int>((x, y) =>
            {
                aReceivedMessage1 = y.RequestMessage;

                // Send the response
                Responser.SendResponseMessage <string>(y.ResponseReceiverId, "hello");
            });

            CustomClass aReceivedMessage2 = null;

            Responser.RegisterRequestMessageReceiver <CustomClass>((x, y) =>
            {
                aReceivedMessage2 = y.RequestMessage;

                // Send the response
                CustomClass aResponse = new CustomClass();
                aResponse.Name        = "Car";
                aResponse.Count       = 100;

                Responser.SendResponseMessage <CustomClass>(y.ResponseReceiverId, aResponse);
            });


            Responser.AttachDuplexInputChannel(DuplexInputChannel);

            string aReceivedResponse1 = "";

            Requester.RegisterResponseMessageReceiver <string>((x, y) =>
            {
                aReceivedResponse1 = y.ResponseMessage;
            });

            CustomClass aReceivedResponse2 = null;

            Requester.RegisterResponseMessageReceiver <CustomClass>((x, y) =>
            {
                aReceivedResponse2 = y.ResponseMessage;

                // Signal that the response message was received -> the loop is closed.
                aMessageReceivedEvent.Set();
            });
            Requester.AttachDuplexOutputChannel(DuplexOutputChannel);

            try
            {
                Requester.SendRequestMessage <int>(1000);

                CustomClass aCustomRequest = new CustomClass();
                aCustomRequest.Name  = "House";
                aCustomRequest.Count = 1000;
                Requester.SendRequestMessage <CustomClass>(aCustomRequest);

                // Wait for the signal that the message is received.
                aMessageReceivedEvent.WaitOne();
                //Assert.IsTrue(aMessageReceivedEvent.WaitOne(2000));
            }
            finally
            {
                Requester.DetachDuplexOutputChannel();
                Responser.DetachDuplexInputChannel();
                Responser.DetachDuplexInputChannel();
            }

            // Check received values
            Assert.AreEqual(1000, aReceivedMessage1);
            Assert.AreEqual("hello", aReceivedResponse1);

            Assert.IsNotNull(aReceivedMessage2);
            Assert.AreEqual("House", aReceivedMessage2.Name);
            Assert.AreEqual(1000, aReceivedMessage2.Count);

            Assert.IsNotNull(aReceivedResponse2);
            Assert.AreEqual("Car", aReceivedResponse2.Name);
            Assert.AreEqual(100, aReceivedResponse2.Count);
        }
Пример #20
0
        public void SendReceive_MultiThreadAccess_1000Messages()
        {
            // The test can be performed from more thread therefore we must synchronize.
            AutoResetEvent aMessageReceivedEvent = new AutoResetEvent(false);

            List <int> aReceivedMessages = new List <int>();

            Responser.MessageReceived += (x, y) =>
            {
                lock (aReceivedMessages)
                {
                    aReceivedMessages.Add(y.RequestMessage);
                }

                // Send the response
                Responser.SendResponseMessage(y.ResponseReceiverId, 1000);
            };


            List <int> aReceivedResponses = new List <int>();

            Requester.ResponseReceived += (x, y) =>
            {
                lock (aReceivedResponses)
                {
                    aReceivedResponses.Add(y.ResponseMessage);

                    if (aReceivedResponses.Count == 1000)
                    {
                        // Signal that the message was received.
                        aMessageReceivedEvent.Set();
                    }
                }
            };


            try
            {
                Responser.AttachDuplexInputChannel(DuplexInputChannel);
                Requester.AttachDuplexOutputChannel(DuplexOutputChannel);

                List <Thread> aThreads = new List <Thread>();

                for (int i = 0; i < 10; ++i)
                {
                    Thread aThread = new Thread(() =>
                    {
                        for (int ii = 0; ii < 100; ++ii)
                        {
                            Requester.SendRequestMessage(2000);
                            Thread.Sleep(1);
                        }
                    });

                    aThreads.Add(aThread);
                }

                aThreads.ForEach(x => x.Start());

                // Wait for the signal that the message is received.
                Assert.IsTrue(aMessageReceivedEvent.WaitOne(10000));
            }
            finally
            {
                Requester.DetachDuplexOutputChannel();
                Responser.DetachDuplexInputChannel();
            }

            // Check received values
            Assert.AreEqual(1000, aReceivedMessages.Count);
            aReceivedMessages.ForEach(x => Assert.AreEqual(2000, x));

            Assert.AreEqual(1000, aReceivedResponses.Count);
            aReceivedResponses.ForEach(x => Assert.AreEqual(1000, x));
        }
Пример #21
0
 public void AddResponser(uint id, Responser responser)
 {
     _responserList.Add(id, responser);
 }