Esempio n. 1
0
 /// <summary>
 ///     Builds the complete arguments for invoking newman
 /// </summary>
 /// <param name="args">The argument builder.</param>
 public void Build(ProcessArgumentBuilder args)
 {
     if (EnvironmentFile != null)
     {
         args.AppendSwitchQuoted(ArgumentNames.Environment, EnvironmentFile.FullPath);
     }
     if (GlobalVariablesFile != null)
     {
         args.AppendSwitchQuoted(ArgumentNames.Globals, GlobalVariablesFile.FullPath);
     }
     if (!string.IsNullOrWhiteSpace(Folder))
     {
         args.AppendSwitchQuoted(ArgumentNames.Folder, Folder);
     }
     if (ExportEnvironmentPath != null)
     {
         args.AppendSwitchQuoted(ArgumentNames.ExportEnvironment, ExportEnvironmentPath.FullPath);
     }
     if (ExportGlobalsPath != null)
     {
         args.AppendSwitchQuoted(ArgumentNames.ExportGlobals, ExportGlobalsPath.FullPath);
     }
     if (ExportCollectionPath != null)
     {
         args.AppendSwitchQuoted(ArgumentNames.ExportCollection, ExportCollectionPath.FullPath);
     }
     if (RequestTimeout != default(int))
     {
         args.AppendSwitch(ArgumentNames.RequestTimeout, RequestTimeout.ToString());
     }
     if (DisableStrictSSL)
     {
         args.Append(ArgumentNames.Insecure);
     }
     if (IgnoreRedirects)
     {
         args.Append(ArgumentNames.IgnoreRedirects);
     }
     if (RequestDelay != default(int))
     {
         args.AppendSwitch(ArgumentNames.RequestDelay, RequestDelay.ToString());
     }
     if (ExitOnFirstFailure)
     {
         args.Append(ArgumentNames.Bail);
     }
     if (Reporters.Any())
     {
         args.AppendSwitch(ArgumentNames.Reporters,
                           string.Join(",", Reporters.Keys.Select(k => k.Trim())));
         foreach (var reporter in Reporters)
         {
             reporter.Value?.RenderOptions(args);
         }
     }
 }
Esempio n. 2
0
 public static void SaveSetting()
 {
     reader.SetNodeText("PingTimeout", PingTimeout.ToString());
     reader.SetNodeText("RequestTimeout", RequestTimeout.ToString());
     reader.SetNodeText("TcpPort", TcpPort.ToString());
     reader.SetNodeText("UdpPort", UdpPort.ToString());
     reader.SetNodeText("ClientPort", ClientPort.ToString());
     reader.SetNodeText("Adapter", Adapter);
     reader.SetNodeText("PlayerID", PlayerID);
     reader.SetNodeText("DataMode", dataMode);
     reader.SetNodeText("SyncMode", syncMode);
     reader.Save("setting.xml");
 }
        protected StringDictionary GetConnectionProperties(BaseTestCase nmsTest)
        {
            StringDictionary properties = new StringDictionary();

            if (EncodingType != null)
            {
                properties[NMSPropertyConstants.NMS_CONNECTION_ENCODING] = EncodingType;
            }
            if (MaxFrameSize != 0)
            {
                properties[NMSPropertyConstants.NMS_CONNECTION_MAX_FRAME_SIZE] = MaxFrameSize.ToString();
            }
            if (CloseTimeout != 0)
            {
                properties[NMSPropertyConstants.NMS_CONNECTION_CLOSE_TIMEOUT] = CloseTimeout.ToString();
            }
            if (RequestTimeout > 0)
            {
                if (properties.ContainsKey(NMSPropertyConstants.NMS_CONNECTION_REQUEST_TIMEOUT))
                {
                    properties.Add(NMSPropertyConstants.NMS_CONNECTION_REQUEST_TIMEOUT, RequestTimeout.ToString());
                }
                else
                {
                    properties[NMSPropertyConstants.NMS_CONNECTION_REQUEST_TIMEOUT] = RequestTimeout.ToString();
                }
            }//*/
            return(properties);
        }