Description of RecordedData.
Inheritance: IRecordedDataItem
コード例 #1
0
ファイル: Recorder.cs プロジェクト: lddd99/guiatuomation
        internal static IRecordedCodeSequence RecordCodeSequence(
            TranscriptCmdletBase cmdlet,
            List <IRecordedCodeSequence> recordingCollection,
            object resultElement,
            IRecordedCodeSequence codeSequence)
        {
            RecordedWebElement elementItem = null;
            RecordedAction     actionItem  = null;
            RecordedData       dataItem    = null;

            var resultWebElement =
                resultElement as IWebElement;
            //RecordedData resultDataCollection =
            //    resultElement as RecordedData;
            var resultDataCollection =
                resultElement as ReadOnlyCollection <object>;

            if (null == codeSequence)
            {
                codeSequence = new RecordedCodeSequence();
            }

            if (null == resultElement)
            {
                return(codeSequence);
            }
//Console.WriteLine(@"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ resultElement.GetType().Name = " + resultElement.GetType().Name);
            if (null != resultWebElement)
            {
                if (IsNotFakeWebElement(resultWebElement))
                {
                    codeSequence =
                        RecordWebItem(cmdlet, codeSequence, resultWebElement, elementItem);
                }
                else     // if (Recorder.isNotFakeWebElement(resultWebElement)) {

                {
                    codeSequence =
                        RecordActionItem(cmdlet, codeSequence, resultWebElement, actionItem);
                } // else
            }

            if (null != resultDataCollection)
            {
                Console.WriteLine(@"////////////////////////////////////////////////////////// null != resultDataCollection " + resultDataCollection.GetType().Name);
                codeSequence =
                    RecordDataItem(cmdlet, codeSequence, resultDataCollection, dataItem);
            }

            cmdlet.WriteVerbose(cmdlet, "RecordCodeSequence");

            return(codeSequence);
        }
コード例 #2
0
 private IRecordedCodeSequence generateDataItem(
     IRecordedCodeSequence codeSequence,
     ReadOnlyCollection<object> dataCollection,
     RecordedData recordingItem)
 {
     IRecordedCodeSequence result =
         Recorder.RecordDataItem(
             (new TranscriptCmdletBase()),
             codeSequence,
             dataCollection,
             recordingItem);
     return result;
 }
コード例 #3
0
ファイル: Recorder.cs プロジェクト: lddd99/guiatuomation
        internal static IRecordedCodeSequence RecordDataItem(
            TranscriptCmdletBase cmdlet,
            IRecordedCodeSequence codeSequence,
            ReadOnlyCollection <object> resultDataCollection,
            RecordedData dataItem)
        {
            if (null == codeSequence)
            {
                codeSequence = new RecordedCodeSequence();
            }

            //if (null == resultDataCollection || 0 == resultDataCollection.UserData.Count) {
            if (null == resultDataCollection || 0 == resultDataCollection.Count)
            {
                return(codeSequence);
            }

            dataItem = new RecordedData();

//int dictionariesCounter = 0;

            var keyKey   = string.Empty;
            var keyValue = string.Empty;

            //codeSequence.Items.Add(resultDataCollection);
            foreach (Dictionary <string, object> data in resultDataCollection)
            {
                try {
                    keyKey = data["key"].ToString();
                } catch {}
                try {
                    if (string.Empty != keyKey)
                    {
                        dataItem.UserData.Add(keyKey, data["value"]);
                    }

                    keyKey   = string.Empty;
                    keyValue = string.Empty;
                } catch {}
            }

            codeSequence.Items.Add(dataItem);

            if (codeSequence.ContainsDataItem())
            {
                codeSequence.ReadyToProduceCode = true;
            }

            return(codeSequence);
        }
コード例 #4
0
ファイル: Recorder.cs プロジェクト: MatkoHanus/STUPS
        internal static IRecordedCodeSequence RecordDataItem(
            TranscriptCmdletBase cmdlet,
            IRecordedCodeSequence codeSequence, 
            ReadOnlyCollection<object> resultDataCollection,
            RecordedData dataItem)
        {
            
            if (null == codeSequence) {
                codeSequence = new RecordedCodeSequence();
            }
            
            //if (null == resultDataCollection || 0 == resultDataCollection.UserData.Count) {
            if (null == resultDataCollection || 0 == resultDataCollection.Count) {
                return codeSequence;
            }
            
            dataItem = new RecordedData();

//int dictionariesCounter = 0;

            string keyKey = string.Empty;
            string keyValue = string.Empty;
            //codeSequence.Items.Add(resultDataCollection);
            foreach (Dictionary<string, object> data in resultDataCollection) {
                try {
                    keyKey = data["key"].ToString();
                } catch {}
                try {
                    if (string.Empty != keyKey) {
                        
                        dataItem.UserData.Add(keyKey, data["value"]);
                        
                    }
                    
                    keyKey = string.Empty;
                    keyValue = string.Empty;
                    
                } catch {}
            }
                
            codeSequence.Items.Add(dataItem);
            
            if (codeSequence.ContainsDataItem()) {
                codeSequence.ReadyToProduceCode = true;
            }

            return codeSequence;
        }
コード例 #5
0
 public void RecordedData_Constructor()
 {
     RecordedData recData = new RecordedData();
     //NUnit.Framework.Assert.NotNull(recData.UserData);
     Assert.IsNotNull(recData.UserData);
 }