Ejemplo n.º 1
0
        public void A_Step_Table_Is_Formatted()
        {
            var mockStyle = new MockStylist
            {
                StepFormat = "Keyword: {0} Step: {1}"
            };
            var step = new Step()
            {
                NativeKeyword = "Natkey ", Name = "I am a step"
            };

            var stepTable = new Table();

            stepTable.HeaderRow = new TableRow(new[] { "Col1", "Col2" });
            stepTable.DataRows  = new System.Collections.Generic.List <ObjectModel.TableRow>();
            stepTable.DataRows.Add(new TableRow(new[] { "Col1Row1", "Col2Row1" }));
            stepTable.DataRows.Add(new TableRow(new[] { "Col1Row2", "Col2Row2" }));
            step.TableArgument = stepTable;

            var stepBlock    = new StepBlock(step, mockStyle);
            var actualString = stepBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

            Assert.AreEqual("Keyword: Natkey Step: I am a step", actualString[0]);
            Assert.AreEqual(">", actualString[1]);
            Assert.AreEqual("> | Col1 | Col2 |", actualString[2]);
            Assert.AreEqual("> | --- | --- |", actualString[3]);
            Assert.AreEqual("> | Col1Row1 | Col2Row1 |", actualString[4]);
            Assert.AreEqual("> | Col1Row2 | Col2Row2 |", actualString[5]);
            Assert.AreEqual(7, actualString.Length);
        }
Ejemplo n.º 2
0
        public void The_Step_Is_Formatted()
        {
            var mockStyle = new MockStylist
            {
                StepFormat = "Keyword: {0} Step: {1}"
            };
            var step = new Step()
            {
                NativeKeyword = "Natkey ", Name = "I am a step"
            };

            var stepBlock    = new StepBlock(step, mockStyle);
            var actualString = stepBlock.ToString().Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

            Assert.AreEqual("Keyword: Natkey Step: I am a step", actualString[0]);
            Assert.AreEqual(2, actualString.Length);
        }