protected virtual void OnCommandExceptionReceived(ioEventArgs e) { if (CommandExceptionReceived != null) { CommandExceptionReceived(this, e); } }
protected virtual void OnCommandResultReceived(ioEventArgs e) { if (CommandResultReceived != null) { CommandResultReceived(this, e); } }
public void ShouldSetCommandNameConstructor() { string commandNameTest = "commandNameTest"; ioEventArgs args = new ioEventArgs(commandNameTest); string resultName = args.CommandName; Assert.That(resultName, Is.SameAs(commandNameTest)); }
/// <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); } }
/// <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); } }
public void ShouldGetBlankExceptionMessage() { ioEventArgs args = new ioEventArgs(""); Assert.That(args.ExceptionMessage, Is.EqualTo("")); }
public void ShouldGetNullData() { ioEventArgs args = new ioEventArgs(""); Assert.That(args.Data, Is.Null); }