/// <summary>
        ///     ITestStep.Execute() implementation
        /// </summary>
        /// <param name='testConfig'>The Xml fragment containing the configuration for this test step</param>
        /// <param name='context'>The context for the test, this holds state that is passed beteen tests</param>
        public void Execute(XmlNode testConfig, Context context)
        {
            var nodelist = testConfig.SelectNodes("VerifyId");

            foreach (XmlNode node in nodelist)
            {
                var valueToVerify = node.InnerText;
                var appinstance   = node.Attributes.GetNamedItem("appInstance").Value;
                var entity        = node.Attributes.GetNamedItem("idXRef").Value;

                var commonId = CrossReferencing.GetCommonID(entity, appinstance, valueToVerify);

                if (string.IsNullOrEmpty(commonId))
                {
                    throw new InvalidOperationException("AppId " + valueToVerify + " not found");
                }

                context.LogInfo("IdXRef = " + entity + ". AppInstance = " + appinstance + ". AppId = " + valueToVerify +
                                ". CommonId = " + commonId);
            }

            var valueNodelist = testConfig.SelectNodes("VerifyValue");

            foreach (XmlNode node in valueNodelist)
            {
                var valueToVerify = node.InnerText;
                var appType       = node.Attributes.GetNamedItem("appType").Value;
                var entity        = node.Attributes.GetNamedItem("valueXRef").Value;

                var commonValue = CrossReferencing.GetCommonValue(entity, appType, valueToVerify);

                if (string.IsNullOrEmpty(commonValue))
                {
                    throw new InvalidOperationException("AppValue " + valueToVerify + " not found");
                }

                context.LogInfo("IdXRef = " + entity + ". AppType = " + appType + ". AppValue = " + valueToVerify +
                                ". CommonValue = " + commonValue);
            }

            context.LogInfo("Cross Reference Id and Value verification is complete");
        }
示例#2
0
        /// <summary>
        /// ITestStep.Execute() implementation
        /// </summary>
        /// <param name='testConfig'>The Xml fragment containing the configuration for this test step</param>
        /// <param name='context'>The context for the test, this holds state that is passed beteen tests</param>
        public void Execute(System.Xml.XmlNode testConfig, Context context)
        {
            XmlNodeList nodelist = testConfig.SelectNodes("VerifyId");

            foreach (XmlNode node in nodelist)
            {
                string valueToVerify = node.InnerText;
                string appinstance   = node.Attributes.GetNamedItem("appInstance").Value;
                string entity        = node.Attributes.GetNamedItem("idXRef").Value;

                string commonId = CrossReferencing.GetCommonID(entity, appinstance, valueToVerify);

                if (commonId == null || commonId == string.Empty)
                {
                    throw new ApplicationException("AppId " + valueToVerify + " not found");
                }

                context.LogInfo("IdXRef = " + entity + ". AppInstance = " + appinstance + ". AppId = " + valueToVerify + ". CommonId = " + commonId);
            }

            XmlNodeList valueNodelist = testConfig.SelectNodes("VerifyValue");

            foreach (XmlNode node in valueNodelist)
            {
                string valueToVerify = node.InnerText;
                string appType       = node.Attributes.GetNamedItem("appType").Value;
                string entity        = node.Attributes.GetNamedItem("valueXRef").Value;

                string commonValue = CrossReferencing.GetCommonValue(entity, appType, valueToVerify);

                if (commonValue == null || commonValue == string.Empty)
                {
                    throw new ApplicationException("AppValue " + valueToVerify + " not found");
                }

                context.LogInfo("IdXRef = " + entity + ". AppType = " + appType + ". AppValue = " + valueToVerify + ". CommonValue = " + commonValue);
            }

            context.LogInfo("Cross Reference Id and Value verification is complete");
        }