public RemovePositionTextForm(RemovePositionTextCommand removePositionTextCommand, int id)
 {
     InitializeComponent();
     _removePositionTextCommand = removePositionTextCommand;
     _id = id;
     UpdateUiFromOperation();
 }
Esempio n. 2
0
            public void WhenLengthIsLessThanZero_ShouldRemoveNoText()
            {
                var classUnderTest = new RemovePositionTextCommand(3, -1);

                classUnderTest.Execute(OriginalText);

                Assert.That(classUnderTest.Result, Is.EqualTo(OriginalText));
            }
Esempio n. 3
0
            public void WhenPositionIsGreaterThanOriginalStringLength_ShouldRemoveNoText()
            {
                var classUnderTest = new RemovePositionTextCommand(OriginalText.Length + 1, 3);

                classUnderTest.Execute(OriginalText);

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

                classUnderTest.Execute("my original string");

                Assert.That(classUnderTest.Result, Is.EqualTo("original string"));
            }
Esempio n. 5
0
            public void WhenPositionAndLengthWithinString_ShouldRemoveText()
            {
                var classUnderTest = new RemovePositionTextCommand(3, 9);

                classUnderTest.Execute("my original string");

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