public void GenerateSummarizedStyleTest4()
        {
            //Arrange
            Style style1 = new Style();

            style1.FontName = "Arial";
            Style style2 = new Style();

            style2.FontName = "MS Serif";
            Style[]         allStyles   = { style1, style2 };
            StyleAssignment styleAssign = new StyleAssignment();

            styleAssign.StyleIndex      = 0;
            styleAssign.StyleName       = "HeadingStyle";
            styleAssign.NamedStyleIndex = 1;
            NamedStyle namedStyle = new NamedStyle();

            namedStyle.Style = style2;
            string            expectedResult = "Arial";
            List <NamedStyle> namedStyles    = new List <NamedStyle>();

            namedStyles.Add(namedStyle);
            //Act
            XElement element      = Utilities.GenerateSummarizedStyle(allStyles, namedStyles, styleAssign);
            string   actualResult = element.Attribute("FontName").Value;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #2
0
        public void StyleNameTestSetAndGet()
        {
            //Arrange
            StyleAssignment styleAssignment = new StyleAssignment();

            styleAssignment.StyleName = "HeadingStyle";
            string expectedResult = "HeadingStyle";
            //Act
            string actualResult = styleAssignment.StyleName;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #3
0
        public void DisplayColumnIndexTestSetAndGet()
        {
            //Arrange
            StyleAssignment styleAssignment = new StyleAssignment();

            styleAssignment.DisplayColumnIndex = 1;
            int expectedResult = 1;
            //Act
            int actualResult = styleAssignment.DisplayColumnIndex;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #4
0
        public void SplitIndexTestSetAndGet()
        {
            //Arrange
            StyleAssignment styleAssignment = new StyleAssignment();

            styleAssignment.SplitIndex = 3;
            int expectedResult = 3;
            //Act
            int actualResult = styleAssignment.SplitIndex;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
        public void GenerateSummarizedStyleTest2()
        {
            //Arrange
            Style style1 = new Style();

            style1.FontName = "Arial";
            Style[]         allStyles   = { style1 };
            StyleAssignment styleAssign = new StyleAssignment();

            styleAssign.StyleIndex = 0;
            styleAssign.StyleName  = "HeadingStyle";
            string expectedResult = "Arial";
            //Act
            XElement element      = Utilities.GenerateSummarizedStyle(allStyles, new List <NamedStyle>(), styleAssign);
            string   actualResult = element.Attribute("FontName").Value;

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemple #6
0
 public void ReadStyleAssignmentInfoTest()
 {
     // Arrange
     FrxReader frxReader = new FrxReader();
     frxReader.FrxFile = new byte[] {
         0x01, 0x00, 0x00, 0x00,
         0x02, 0x00, 0x00, 0x00,
         0x03, 0x00, 0x00, 0x00,
         0x04, 0x00, 0x00, 0x00,
         0x05, 0x00, 0x00, 0x00
     };
     // Act
     StyleAssignment styleAssignment = frxReader.ReadStyleAssignmentInfo("CaptionStyle");
     bool actualResult = styleAssignment.StyleIndex == 2 &&
         styleAssignment.SplitIndex == 3 &&
         styleAssignment.DisplayColumnIndex == 4 &&
         styleAssignment.NamedStyleIndex == 5;
     // Assert
     Assert.IsTrue(actualResult);
 }