Exemplo n.º 1
0
        public void Should_Be_Replaced_All_Old_Text_With_Another(string oldText, string newText)
        {
            //Arrange
            var line = new LineBuilder();

            line.AddText(oldText);
            line.AddText(oldText);

            //Act
            line.ReplaceAll(oldText, newText);

            //Assert
            var validate = line.GetText(1) == newText &&
                           line.GetText(2) == newText;

            validate.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void Should_Be_Add_Text_In_Specific_Column_Exception_Column()
        {
            //Arrange
            var line = new LineBuilder();
            var text = FakerPrimitiveTypes.GetSampleText(1, 100);

            //Act
            Action act = () => line.AddText(0, text);

            //Assert
            act.Should().Throw <Exception>().WithMessage("Invalid column position. Minimum value it's 1.");
        }
Exemplo n.º 3
0
        public void Should_Be_Replaced_One_Text_With_Another(string oldText, string newText)
        {
            //Arrange
            var line = new LineBuilder();

            line.AddText(oldText);

            //Act
            line.Replace(oldText, newText);

            //Assert
            line.GetText(1).Should().Be(newText);
        }
Exemplo n.º 4
0
        public void Should_Be_Add_Text_Success()
        {
            //Arrange
            var line = new LineBuilder();
            var text = FakerPrimitiveTypes.GetSampleText(0, 10000);

            line.AddText(text);

            //Act
            var validateTest = line.GetText(1) == text;

            //Assert
            validateTest.Should().BeTrue();
        }
Exemplo n.º 5
0
        public void Should_Be_Add_An_Null_Text_Success()
        {
            //Arrange
            var    line = new LineBuilder();
            string text = null;

            line.AddText(text);

            //Act
            var validateTest = line.GetText(0) == string.Empty;

            //Assert
            validateTest.Should().BeTrue();
        }
Exemplo n.º 6
0
        public void Should_Be_Add_Text_In_Multiple_Columns_Success(int amountColumns)
        {
            //Arrange
            var line = new LineBuilder();

            var items = new Dictionary <int, string>();

            for (int column = 1; column <= amountColumns; column++)
            {
                var text = FakerPrimitiveTypes.GetSampleText(0, 10000);
                line.AddText(text);

                items.Add(column, text);
            }

            //Act
            var validateTest = items.All(i => line.GetText(i.Key) == i.Value);

            //Assert
            validateTest.Should().BeTrue();
        }