Example #1
0
            public void WhenLengthIsLessThanZero_ShouldRemoveNoText()
            {
                var classUnderTest = new RemovePositionTextCommand(3, -1);

                classUnderTest.Execute(OriginalText);

                Assert.That(classUnderTest.Result, Is.EqualTo(OriginalText));
            }
Example #2
0
            public void WhenPositionIsLessThanZero_ShouldRemoveFromPositionZero()
            {
                var classUnderTest = new RemovePositionTextCommand(-1, 3);

                classUnderTest.Execute("my original string");

                Assert.That(classUnderTest.Result, Is.EqualTo("original string"));
            }
Example #3
0
            public void WhenPositionIsGreaterThanOriginalStringLength_ShouldRemoveNoText()
            {
                var classUnderTest = new RemovePositionTextCommand(OriginalText.Length + 1, 3);

                classUnderTest.Execute(OriginalText);

                Assert.That(classUnderTest.Result, Is.EqualTo(OriginalText));
            }
Example #4
0
            public void WhenPositionAndLengthWithinString_ShouldRemoveText()
            {
                var classUnderTest = new RemovePositionTextCommand(3, 9);

                classUnderTest.Execute("my original string");

                Assert.That(classUnderTest.Result, Is.EqualTo("my string"));
            }