public void SpreadsheetHelper_DisplayWidth()
 {
     TestClassWithDisplayWidth tc1 = new TestClassWithDisplayWidth();
     Spreadsheet doc = new Spreadsheet();
     doc.CreateAndAppendWorksheet<TestClassWithDisplayWidth>(new List<TestClassWithDisplayWidth>() { tc1 });
     PropertyInfo[] props = typeof(TestClassWithDisplayWidth).GetProperties();
     int columnIndex = 1;
     foreach (PropertyInfo prop in typeof(TestClassWithDisplayWidth).GetProperties())
     {
         foreach (DisplayWidth dw in prop.GetCustomAttributes(typeof(DisplayWidth)))
         {
             Assert.AreEqual(dw.Width, doc.doc.GetColumnWidth(columnIndex));
             break;
         }
         columnIndex++;
     }
 }
示例#2
0
        public void SpreadsheetHelper_DisplayWidth()
        {
            TestClassWithDisplayWidth tc1 = new TestClassWithDisplayWidth();
            Spreadsheet doc = new Spreadsheet();

            doc.CreateAndAppendWorksheet <TestClassWithDisplayWidth>(new List <TestClassWithDisplayWidth>()
            {
                tc1
            });
            PropertyInfo[] props       = typeof(TestClassWithDisplayWidth).GetProperties();
            int            columnIndex = 1;

            foreach (PropertyInfo prop in typeof(TestClassWithDisplayWidth).GetProperties())
            {
                foreach (DisplayWidth dw in prop.GetCustomAttributes(typeof(DisplayWidth)))
                {
                    Assert.AreEqual(dw.Width, doc.doc.GetColumnWidth(columnIndex));
                    break;
                }
                columnIndex++;
            }
        }