Esempio n. 1
0
        public void ProcessClosesTagBoldIfFontFormatIsCurrentlyBold()
        {
            //Arrange
            var italicsCommand = new Italics();
            var currentPdf     = new CurrentPdf();

            currentPdf.StringBuilder     = new StringBuilder();
            currentPdf.CurrentFontFormat = FontFormat.Bold;

            var expectedValue = "</b><i>";

            //Act
            italicsCommand.Process(ref currentPdf);

            //Assert
            Assert.AreEqual(expectedValue, currentPdf.StringBuilder.ToString());
            Assert.AreEqual(FontFormat.Italics, currentPdf.CurrentFontFormat);
        }
Esempio n. 2
0
        public void ProcessAppendsItalicsTagToStringBuilder(FontFormat currentFontFormat)
        {
            //Arrange
            var italicsCommand = new Italics();
            var currentPdf     = new CurrentPdf();

            currentPdf.StringBuilder     = new StringBuilder();
            currentPdf.CurrentFontFormat = currentFontFormat;

            var expectedValue = "<i>";

            //Act
            italicsCommand.Process(ref currentPdf);

            //Assert
            Assert.AreEqual(expectedValue, currentPdf.StringBuilder.ToString());
            Assert.AreEqual(FontFormat.Italics, currentPdf.CurrentFontFormat);
        }