Exemple #1
0
 protected virtual void OnCommandExceptionReceived(ioEventArgs e)
 {
     if (CommandExceptionReceived != null)
     {
         CommandExceptionReceived(this, e);
     }
 }
Exemple #2
0
 protected virtual void OnCommandResultReceived(ioEventArgs e)
 {
     if (CommandResultReceived != null)
     {
         CommandResultReceived(this, e);
     }
 }
Exemple #3
0
        public void ShouldSetCommandNameConstructor()
        {
            string      commandNameTest = "commandNameTest";
            ioEventArgs args            = new ioEventArgs(commandNameTest);
            string      resultName      = args.CommandName;

            Assert.That(resultName, Is.SameAs(commandNameTest));
        }
Exemple #4
0
        /// <summary>
        /// Event handler for data received via standard error on the child process.
        /// </summary>
        private void Process_ErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            ioResult rpcResult;

            if (ioResult.TryParse(e.Data, out rpcResult))
            {
                ioEventArgs eventArgs = new ioEventArgs(rpcResult.CommandName);
                eventArgs.ExceptionMessage = rpcResult.ExceptionMessage;
                OnCommandExceptionReceived(eventArgs);
            }
        }
Exemple #5
0
        /// <summary>
        /// Event handler for data received via standard out on the child process.
        /// </summary>
        private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            ioResult rpcResult;

            if (ioResult.TryParse(e.Data, out rpcResult))
            {
                ioEventArgs eventArgs = new ioEventArgs(rpcResult.CommandName);
                eventArgs.Data = rpcResult.Data;
                OnCommandResultReceived(eventArgs);
            }
        }
Exemple #6
0
        public void ShouldGetBlankExceptionMessage()
        {
            ioEventArgs args = new ioEventArgs("");

            Assert.That(args.ExceptionMessage, Is.EqualTo(""));
        }
Exemple #7
0
        public void ShouldGetNullData()
        {
            ioEventArgs args = new ioEventArgs("");

            Assert.That(args.Data, Is.Null);
        }