コード例 #1
0
        /// <inheritdoc/>
        public ITestStep SetUpTestStep(string testStepFileLocation, bool performAction = true)
        {
            TextInteractor interactor        = new TextInteractor(testStepFileLocation);
            Dictionary <string, string> args = new Dictionary <string, string>();

            interactor.Open();
            while (!interactor.FinishedReading())
            {
                this.FileData.Add(interactor.ReadLine());
            }

            interactor.Close();

            string[] values   = this.FileData[0].Split(';');
            TestStep testStep = ReflectiveGetter.GetEnumerableOfType <TestStep>()
                                .Find(x => x.Name.Equals(values[1]));

            testStep.Name = values[0];

            foreach (string arg in values[2].Split(','))
            {
                string[] value = arg.Split('=');
                args.Add(value[0], value[1]);
            }

            testStep.Arguments = args;

            return(testStep);
        }
コード例 #2
0
        /// <inheritdoc/>
        public ITestCase SetUpTestCase(string txtFile, bool performAction = true)
        {
            TextInteractor interactor = new TextInteractor(txtFile);

            interactor.Open();
            while (!interactor.FinishedReading())
            {
                this.FileData.Add(interactor.ReadLine());
            }

            interactor.Close();

            this.FileIndex = 0;

            ITestCase testCase = new TestCase()
            {
                Name = txtFile,
                ShouldExecuteVariable = performAction,
            };

            return(testCase);
        }