コード例 #1
0
        public void TestFileReader_FileHasStepsNotHavingInputs_StepsShouldBeLoaded()
        {
            TestFileReader testReader = new TestFileReader(fileService);

            testReader.LoadFile("my test");

            var steps = testReader.GetTestSteps();

            // steps 1 and 3 do not have inputs
            steps[0].Inputs.Should().HaveCount(0);
            steps[2].Inputs.Should().HaveCount(0);
        }
コード例 #2
0
        public void TestFileReader_ReadsTestStepsWithInputs_ParsesInputParameters()
        {
            TestFileReader testReader = new TestFileReader(fileService);

            testReader.LoadFile("my test");

            var steps = testReader.GetTestSteps();

            // steps 2 has inputs
            steps[1].Keyword.Should().Be("Do something that needs inputs");
            steps[1].Inputs.Should().HaveCount(2);
            steps[1].Inputs["Input1"].Should().Be("walla walla additional for Input1");
            steps[1].Inputs["Input2"].Should().Be("12345");
            steps[3].Keyword.Should().Be("Another step with inputs");
            steps[3].Inputs.Should().HaveCount(2);
            steps[3].Inputs["variable"].Should().Be("${timestamp}");
            steps[3].Inputs["BlankValue"].Should().BeEmpty();
        }
コード例 #3
0
        public void TestFileReader_LoadsFileWithoutTestCase_ReturnsZeroSteps()
        {
            fileService.GetLines(Arg.Any <string>()).Returns(new List <string>()
            {
                "*** Settings ***",
                "Library  BadgerTests.dll",
                "",
                "*** Variables ***",
                "timestamp  ${Faker.CreateTimeStamp(\"yyyyMMdd\")}",
                "user  Chewbacca"
            });
            TestFileReader testReader = new TestFileReader(fileService);

            testReader.LoadFile("my test");

            var steps = testReader.GetTestSteps();

            steps.Should().HaveCount(0);
        }