Esempio n. 1
0
        public void CheckCodeSequenceNovelty_RecordingCollection_Null_CodeSequence_Empty()
        {
            bool result                 = false;
            bool expectedResult         = false;
            TranscriptCmdletBase cmdlet = new TranscriptCmdletBase();

            Recorder.RecordingCollection = null;
            IRecordedCodeSequence codeSequence = new RecordedCodeSequence();

            result =
                Recorder.CheckCodeSequenceNovelty(
                    cmdlet,
                    Recorder.RecordingCollection,
                    codeSequence);
            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 2
0
        public void CheckCodeSequenceNovelty_CodeSequence_Null()
        {
            bool result                 = false;
            bool expectedResult         = false;
            TranscriptCmdletBase cmdlet = new TranscriptCmdletBase();

            Recorder.RecordingCollection =
                new System.Collections.Generic.List <IRecordedCodeSequence>();
            IRecordedCodeSequence codeSequence = null;

            result =
                Recorder.CheckCodeSequenceNovelty(
                    cmdlet,
                    Recorder.RecordingCollection,
                    codeSequence);
            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 3
0
        public void CheckCodeSequenceNovelty_RecordingCollection_Empty_CodeSequence_Non_Empty()
        {
            bool result                 = false;
            bool expectedResult         = true;
            TranscriptCmdletBase cmdlet = new TranscriptCmdletBase();

            Recorder.RecordingCollection =
                new System.Collections.Generic.List <IRecordedCodeSequence>();
            IRecordedCodeSequence codeSequence = new RecordedCodeSequence();

            codeSequence.Items.Add((new RecordedAction()));
            result =
                Recorder.CheckCodeSequenceNovelty(
                    cmdlet,
                    Recorder.RecordingCollection,
                    codeSequence);
            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 4
0
        public void CheckCodeSequenceNovelty_CodeSequence_Duplicated()
        {
            bool result                 = false;
            bool expectedResult         = false;
            TranscriptCmdletBase cmdlet = new TranscriptCmdletBase();

            Recorder.RecordingCollection =
                new System.Collections.Generic.List <IRecordedCodeSequence>();
            IRecordedCodeSequence codeSequence = new RecordedCodeSequence();
            RecordedWebElement    webElement   = new RecordedWebElement();

            webElement.TagName = "button";
            codeSequence.Items.Add(webElement);
            RecordedAction action = new RecordedAction();

            action.UserData.Add("code", Recorder.CodeGenElementClick);
            codeSequence.Items.Add(action);

            Recorder.RecordingCollection.Add(codeSequence);

            // a new code sequence
            codeSequence       = new RecordedCodeSequence();
            webElement         = new RecordedWebElement();
            webElement.TagName = "button";
            codeSequence.Items.Add(webElement);
            action = new RecordedAction();
            action.UserData.Add("code", Recorder.CodeGenElementClick);
            codeSequence.Items.Add(action);

            result =
                Recorder.CheckCodeSequenceNovelty(
                    cmdlet,
                    Recorder.RecordingCollection,
                    codeSequence);
            Assert.AreEqual(expectedResult, result);
        }