예제 #1
0
        public string [] ReportDetails(string aName)
        {
            string   Environment   = string.Empty;
            string   testSuiteName = string.Empty;
            string   buildVersion  = string.Empty;
            string   clientID      = string.Empty;
            string   appUnderTest  = string.Empty;
            ClientID clientIdObj;
            Type     clientIdClassType;

            string[] appName = aName.Split('.');

            if (ConfigurationManager.AppSettings["JenkinsExecution"].Equals("true"))
            {
                Environment = System.Environment.GetEnvironmentVariable("Env");
                testSuite.SetSuiteName(System.Environment.GetEnvironmentVariable("ExecutionType"));
                //testSuiteName = System.Environment.GetEnvironmentVariable("ExecutionType");
                buildVersion = System.Environment.GetEnvironmentVariable("Build_Version");
                if (aName.StartsWith("Bnp.Core"))
                {
                    clientIdObj       = new ClientID();
                    clientIdClassType = clientIdObj.GetType();
                    clientID          = clientIdClassType.GetField("Core").GetValue(clientIdObj).ToString();
                }
                else
                {
                    clientIdObj       = new ClientID();
                    clientIdClassType = clientIdObj.GetType();
                    clientID          = clientIdClassType.GetField(appName[0]).GetValue(clientIdObj).ToString();
                }
                appUnderTest = " " + appName[3].ToString() + " - " + appName[4].ToString();
                return(new[] { Environment, testSuiteName, buildVersion, clientID, appUnderTest });
            }
            else if (aName.Equals("Bnp.Core.OrderExecutionTests"))
            {
                Environment = ConfigurationManager.AppSettings["Environment"];
                // testSuiteName = OrderExecutionTests.ordTestSuiteName;
                testSuite.SetSuiteName(OrderExecutionTests.ordTestSuiteName);
                buildVersion = ConfigurationManager.AppSettings["Version"];
                if (aName.StartsWith("Bnp.Core"))
                {
                    clientIdObj       = new ClientID();
                    clientIdClassType = clientIdObj.GetType();
                    clientID          = clientIdClassType.GetField("Core").GetValue(clientIdObj).ToString();
                }
                else
                {
                    clientIdObj       = new ClientID();
                    clientIdClassType = clientIdObj.GetType();
                    clientID          = clientIdClassType.GetField(appName[0]).GetValue(clientIdObj).ToString();
                }
                appUnderTest = "";
                //appUnderTest = " " + appName[3].ToString() + " - " + appName[4].ToString();
                return(new[] { Environment, testSuiteName, buildVersion, clientID, appUnderTest });
            }
            else
            {
                Environment = ConfigurationManager.AppSettings["Environment"];
                //testSuiteName = ConfigurationManager.AppSettings["TestSuiteName"];
                testSuite.SetSuiteName(ConfigurationManager.AppSettings["TestSuiteName"]);
                buildVersion = ConfigurationManager.AppSettings["Version"];
                if (aName.StartsWith("Bnp.Core"))
                {
                    clientIdObj       = new ClientID();
                    clientIdClassType = clientIdObj.GetType();
                    clientID          = clientIdClassType.GetField("Core").GetValue(clientIdObj).ToString();
                }
                else
                {
                    clientIdObj       = new ClientID();
                    clientIdClassType = clientIdObj.GetType();
                    clientID          = clientIdClassType.GetField(appName[0]).GetValue(clientIdObj).ToString();
                }
                appUnderTest = " " + appName[3].ToString() + " - " + appName[4].ToString();
                return(new[] { Environment, testSuiteName, buildVersion, clientID, appUnderTest });
            }
        }