예제 #1
0
        public void ProcessClosesItalicsTagIfFontFormatIsCurrentlyItalics()
        {
            //Arrange
            var boldCommand = new Bold();
            var currentPdf  = new CurrentPdf();

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

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

            //Act
            boldCommand.Process(ref currentPdf);

            //Assert
            Assert.AreEqual(expectedValue, currentPdf.StringBuilder.ToString());
            Assert.AreEqual(FontFormat.Bold, currentPdf.CurrentFontFormat);
        }
예제 #2
0
        public void ProcessAppendsBoldTagToStringBuilder(FontFormat currentFontFormat)
        {
            //Arrange
            var boldCommand = new Bold();
            var currentPdf  = new CurrentPdf();

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

            var expectedValue = "<b>";

            //Act
            boldCommand.Process(ref currentPdf);

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