コード例 #1
0
        public void ParagraphTextSetter_ThrowsException_WhenParagraphWasRemoved()
        {
            IPresentation presentation = SCPresentation.Open(Properties.Resources._020, true);
            IAutoShape    autoShape    = (IAutoShape)presentation.Slides[2].Shapes.First(sp => sp.Id == 8);
            ITextBox      textBox      = autoShape.TextBox;
            IParagraph    paragraph    = textBox.Paragraphs.First();

            textBox.Text = "new box content";

            // Act-Assert
            paragraph.Invoking(p => p.Text = "new paragraph text")
            .Should().Throw <ElementIsRemovedException>("because paragraph was being removed while changing box content.");
        }