public void WhenEndPosIsGreaterThanLength_ShouldCutPaste()
            {
                var classUnderTest = new CutCopyPasteCommand(3, 8, 19, true);

                classUnderTest.Execute("my original string");

                Assert.That(classUnderTest.Result, Is.EqualTo("my  stringoriginal"));
            }
            public void WhenIsCutTrue_ShouldCutPaste()
            {
                var classUnderTest = new CutCopyPasteCommand(3, 8, 18, true);

                classUnderTest.Execute("my original string");

                Assert.That(classUnderTest.Result, Is.EqualTo("my  stringoriginal"));
            }
            public void WhenCopyPosLessThanZero_ShouldCopyPaste()
            {
                var classUnderTest = new CutCopyPasteCommand(-1, 2, 18, false);

                classUnderTest.Execute("my original string");

                Assert.That(classUnderTest.Result, Is.EqualTo("my original stringmy"));
            }
            public void WhenCopyLengthIsLongerThanTextLength_ShouldThrowException()
            {
                const int copyLength = 5;

                var classUnderTest = new CutCopyPasteCommand(0, copyLength, 0, false);

                Assert.Throws <FileRenameCommandValidationException>(() => classUnderTest.Execute("test.txt"));
            }
            public void WhenCopyLengthLessThanOne_ShouldThrowException()
            {
                const int copyLength = 0;

                var classUnderTest = new CutCopyPasteCommand(3, copyLength, 18, false);

                Assert.Throws <FileRenameCommandValidationException>(() => classUnderTest.Execute("my original string"));
            }
예제 #6
0
        public CopyPasteForm(CutCopyPasteCommand command, int id)
        {
            InitializeComponent();

            _command = command;
            _id      = id;

            UpdateUiFromOperation();
        }