Skip to content

Commit 33b2a1c

Browse files
committed
.
1 parent b385c98 commit 33b2a1c

File tree

9 files changed

+279
-88
lines changed

9 files changed

+279
-88
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Task XLWorkbook()
9797
<a id='snippet-Samples.VerifyExcel.verified.csv'></a>
9898
```csv
9999
0,First Name,Last Name,Gender,Country,Date,Age,Id,Formula
100-
1,Dulce,Abril,Female,United States,2017-10-15,32,1562,G2+H21594
100+
1,Dulce,Abril,Female,United States,2017-10-15,32,1562,1594
101101
2,Mara,Hashimoto,Female,Great Britain,2016-08-16,25,1582,1607
102102
3,Philip,Gent,Male,France,2015-05-21,36,2587,2623
103103
4,Kathleen,Hanner,Female,United States,2017-10-15,25,3549,3574

src/Tests/Samples.MultipleSheets.verified.txt

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,88 @@
22
SheetNames: [
33
Sheet1,
44
Sheet2
5-
]
5+
],
6+
Author: simon,
7+
ColumnWidth: 8.43,
8+
Properties: {
9+
Title: The Title,
10+
Modified: DateTime_1,
11+
LastModifiedBy: Simon Cropp
12+
},
13+
WorksheetCount: 2,
14+
Theme: {
15+
Background1: Color [A=255, R=255, G=255, B=255],
16+
Text1: Color [Black],
17+
Background2: Color [A=255, R=231, G=230, B=230],
18+
Text2: Color [A=255, R=68, G=84, B=106],
19+
Accent1: Color [A=255, R=68, G=114, B=196],
20+
Accent2: Color [A=255, R=237, G=125, B=49],
21+
Accent3: Color [A=255, R=165, G=165, B=165],
22+
Accent4: Color [A=255, R=255, G=192, B=0],
23+
Accent5: Color [A=255, R=91, G=155, B=213],
24+
Accent6: Color [A=255, R=112, G=173, B=71],
25+
Hyperlink: Color [A=255, R=5, G=99, B=193],
26+
FollowedHyperlink: Color [A=255, R=149, G=79, B=114]
27+
},
28+
Use1904DateSystem: false,
29+
DefaultFont: Arial,
30+
CalculateMode: Default,
31+
ShowFormulas: false,
32+
ShowGridLines: true,
33+
ShowRowColHeaders: true,
34+
ShowOutlineSymbols: true,
35+
ShowZeros: true,
36+
ShowRuler: true,
37+
ShowWhiteSpace: true,
38+
Style: {
39+
Font: {
40+
Bold: false,
41+
Italic: false,
42+
Underline: None,
43+
Strikethrough: false,
44+
Shadow: false,
45+
FontSize: 10.0,
46+
FontColor: Color [Black],
47+
FontName: Arial,
48+
FontFamilyNumbering: Swiss,
49+
FontCharSet: Default
50+
},
51+
Alignment: {
52+
Horizontal: General,
53+
JustifyLastLine: false,
54+
ShrinkToFit: false,
55+
WrapText: false,
56+
TopToBottom: false
57+
},
58+
Border: {
59+
LeftBorder: None,
60+
LeftBorderColor: Color [Black],
61+
RightBorder: None,
62+
RightBorderColor: Color [Black],
63+
TopBorder: None,
64+
TopBorderColor: Color [Black],
65+
BottomBorder: None,
66+
BottomBorderColor: Color [Black],
67+
DiagonalBorder: None,
68+
DiagonalBorderColor: Color [Black],
69+
DiagonalUp: false,
70+
DiagonalDown: false
71+
},
72+
Fill: {
73+
BackgroundColor: Color [Transparent],
74+
PatternColor: Color [Transparent],
75+
PatternType: None
76+
},
77+
IncludeQuotePrefix: false,
78+
NumberFormat: {
79+
Format:
80+
},
81+
Protection: {
82+
Locked: true,
83+
Hidden: false
84+
},
85+
DateFormat: {
86+
Format:
87+
}
88+
}
689
}
Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,88 @@
11
{
22
SheetNames: [
33
Sheet1
4-
]
4+
],
5+
Author: simon,
6+
ColumnWidth: 8.43,
7+
Properties: {
8+
Title: The Title,
9+
Modified: DateTime_1,
10+
LastModifiedBy: Simon Cropp
11+
},
12+
WorksheetCount: 1,
13+
Theme: {
14+
Background1: Color [A=255, R=255, G=255, B=255],
15+
Text1: Color [Black],
16+
Background2: Color [A=255, R=231, G=230, B=230],
17+
Text2: Color [A=255, R=68, G=84, B=106],
18+
Accent1: Color [A=255, R=68, G=114, B=196],
19+
Accent2: Color [A=255, R=237, G=125, B=49],
20+
Accent3: Color [A=255, R=165, G=165, B=165],
21+
Accent4: Color [A=255, R=255, G=192, B=0],
22+
Accent5: Color [A=255, R=91, G=155, B=213],
23+
Accent6: Color [A=255, R=112, G=173, B=71],
24+
Hyperlink: Color [A=255, R=5, G=99, B=193],
25+
FollowedHyperlink: Color [A=255, R=149, G=79, B=114]
26+
},
27+
Use1904DateSystem: false,
28+
DefaultFont: Arial,
29+
CalculateMode: Default,
30+
ShowFormulas: false,
31+
ShowGridLines: true,
32+
ShowRowColHeaders: true,
33+
ShowOutlineSymbols: true,
34+
ShowZeros: true,
35+
ShowRuler: true,
36+
ShowWhiteSpace: true,
37+
Style: {
38+
Font: {
39+
Bold: false,
40+
Italic: false,
41+
Underline: None,
42+
Strikethrough: false,
43+
Shadow: false,
44+
FontSize: 10.0,
45+
FontColor: Color [Black],
46+
FontName: Arial,
47+
FontFamilyNumbering: Swiss,
48+
FontCharSet: Default
49+
},
50+
Alignment: {
51+
Horizontal: General,
52+
JustifyLastLine: false,
53+
ShrinkToFit: false,
54+
WrapText: false,
55+
TopToBottom: false
56+
},
57+
Border: {
58+
LeftBorder: None,
59+
LeftBorderColor: Color [Black],
60+
RightBorder: None,
61+
RightBorderColor: Color [Black],
62+
TopBorder: None,
63+
TopBorderColor: Color [Black],
64+
BottomBorder: None,
65+
BottomBorderColor: Color [Black],
66+
DiagonalBorder: None,
67+
DiagonalBorderColor: Color [Black],
68+
DiagonalUp: false,
69+
DiagonalDown: false
70+
},
71+
Fill: {
72+
BackgroundColor: Color [Transparent],
73+
PatternColor: Color [Transparent],
74+
PatternType: None
75+
},
76+
IncludeQuotePrefix: false,
77+
NumberFormat: {
78+
Format:
79+
},
80+
Protection: {
81+
Locked: true,
82+
Hidden: false
83+
},
84+
DateFormat: {
85+
Format:
86+
}
87+
}
588
}

src/Tests/Samples.VerifyExcelStream.verified.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
0,First Name,Last Name,Gender,Country,Date,Age,Id,Formula
2-
1,Dulce,Abril,Female,United States,2017-10-15,32,1562,G2+H21594
2+
1,Dulce,Abril,Female,United States,2017-10-15,32,1562,1594
33
2,Mara,Hashimoto,Female,Great Britain,2016-08-16,25,1582,1607
44
3,Philip,Gent,Male,France,2015-05-21,36,2587,2623
55
4,Kathleen,Hanner,Female,United States,2017-10-15,25,3549,3574

src/Tests/Samples.VerifyExcelStream.verified.txt

Lines changed: 78 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,87 @@
22
SheetNames: [
33
Sheet1
44
],
5-
CellFormats: [
6-
{
7-
FontId: 0,
8-
FillId: 0,
9-
BorderId: 0,
10-
NumberFormatId: 0: General,
11-
FormatId: 0
5+
Author: simon,
6+
ColumnWidth: 8.43,
7+
Properties: {
8+
Title: The Title,
9+
Modified: DateTime_1,
10+
LastModifiedBy: Simon Cropp
11+
},
12+
WorksheetCount: 1,
13+
Theme: {
14+
Background1: Color [A=255, R=255, G=255, B=255],
15+
Text1: Color [Black],
16+
Background2: Color [A=255, R=231, G=230, B=230],
17+
Text2: Color [A=255, R=68, G=84, B=106],
18+
Accent1: Color [A=255, R=68, G=114, B=196],
19+
Accent2: Color [A=255, R=237, G=125, B=49],
20+
Accent3: Color [A=255, R=165, G=165, B=165],
21+
Accent4: Color [A=255, R=255, G=192, B=0],
22+
Accent5: Color [A=255, R=91, G=155, B=213],
23+
Accent6: Color [A=255, R=112, G=173, B=71],
24+
Hyperlink: Color [A=255, R=5, G=99, B=193],
25+
FollowedHyperlink: Color [A=255, R=149, G=79, B=114]
26+
},
27+
Use1904DateSystem: false,
28+
DefaultFont: Arial,
29+
CalculateMode: Default,
30+
ShowFormulas: false,
31+
ShowGridLines: true,
32+
ShowRowColHeaders: true,
33+
ShowOutlineSymbols: true,
34+
ShowZeros: true,
35+
ShowRuler: true,
36+
ShowWhiteSpace: true,
37+
Style: {
38+
Font: {
39+
Bold: false,
40+
Italic: false,
41+
Underline: None,
42+
Strikethrough: false,
43+
Shadow: false,
44+
FontSize: 10.0,
45+
FontColor: Color [Black],
46+
FontName: Arial,
47+
FontFamilyNumbering: Swiss,
48+
FontCharSet: Default
1249
},
13-
{
14-
FontId: 1,
15-
FillId: 0,
16-
BorderId: 0,
17-
NumberFormatId: 0: General,
18-
FormatId: 0,
19-
ApplyFont: 1
50+
Alignment: {
51+
Horizontal: General,
52+
JustifyLastLine: false,
53+
ShrinkToFit: false,
54+
WrapText: false,
55+
TopToBottom: false
2056
},
21-
{
22-
FontId: 2,
23-
FillId: 0,
24-
BorderId: 0,
25-
NumberFormatId: 0: General,
26-
FormatId: 0,
27-
ApplyFont: 1
57+
Border: {
58+
LeftBorder: None,
59+
LeftBorderColor: Color [Black],
60+
RightBorder: None,
61+
RightBorderColor: Color [Black],
62+
TopBorder: None,
63+
TopBorderColor: Color [Black],
64+
BottomBorder: None,
65+
BottomBorderColor: Color [Black],
66+
DiagonalBorder: None,
67+
DiagonalBorderColor: Color [Black],
68+
DiagonalUp: false,
69+
DiagonalDown: false
2870
},
29-
{
30-
FontId: 2,
31-
FillId: 0,
32-
BorderId: 0,
33-
NumberFormatId: 14: m/d/yyyy,
34-
FormatId: 0,
35-
ApplyNumberFormat: 1,
36-
ApplyFont: 1
71+
Fill: {
72+
BackgroundColor: Color [Transparent],
73+
PatternColor: Color [Transparent],
74+
PatternType: None
3775
},
38-
{
39-
FontId: 0,
40-
FillId: 0,
41-
BorderId: 0,
42-
NumberFormatId: 14: m/d/yyyy,
43-
FormatId: 0,
44-
ApplyNumberFormat: 1
76+
IncludeQuotePrefix: false,
77+
NumberFormat: {
78+
Format:
79+
},
80+
Protection: {
81+
Locked: true,
82+
Hidden: false
83+
},
84+
DateFormat: {
85+
Format:
4586
}
46-
]
87+
}
4788
}
Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
1-
// class CellFormatConverter :
2-
// WriteOnlyJsonConverter<CellFormat>
3-
// {
4-
// public override void Write(VerifyJsonWriter writer, CellFormat options)
5-
// {
6-
// writer.WriteStartObject();
7-
// writer.WriteMember(options, options.Alignment, "Alignment");
8-
// writer.WriteMember(options, options.Protection, "Protection");
9-
// writer.WriteMember(options, options.FontId, "FontId");
10-
// writer.WriteMember(options, options.FillId, "FillId");
11-
// writer.WriteMember(options, options.BorderId, "BorderId");
12-
//
13-
// if (options.NumberFormatId != null)
14-
// {
15-
// var format = NumberFormatConverter.GetReadableFormat(options.NumberFormatId, VerifyOpenXml.CurrentDocument!.WorkbookPart!);
16-
// writer.WriteMember(options, format, "NumberFormatId");
17-
// }
18-
//
19-
// writer.WriteMember(options, options.FormatId, "FormatId");
20-
// writer.WriteMember(options, options.ApplyNumberFormat, "ApplyNumberFormat");
21-
// writer.WriteMember(options, options.ApplyFont, "ApplyFont");
22-
// writer.WriteMember(options, options.ApplyFill, "ApplyFill");
23-
// writer.WriteMember(options, options.ApplyBorder, "ApplyBorder");
24-
// writer.WriteMember(options, options.ApplyAlignment, "ApplyAlignment");
25-
// writer.WriteMember(options, options.ApplyProtection, "ApplyProtection");
26-
// writer.WriteMember(options, options.PivotButton, "PivotButton");
27-
// writer.WriteMember(options, options.QuotePrefix, "QuotePrefix");
28-
// writer.WriteEndObject();
29-
// }
30-
// }
1+
class ColorConverter :
2+
WriteOnlyJsonConverter<XLColor>
3+
{
4+
public override void Write(VerifyJsonWriter writer, XLColor target) =>
5+
writer.WriteValue(target.Color.ToString());
6+
}

src/Verify.OpenXml/GlobalUsings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// Global using directives
22

3+
global using System.Globalization;
4+
global using Argon;
5+
global using ClosedXML.Excel;
36
global using DocumentFormat.OpenXml.Packaging;
47
global using DocumentFormat.OpenXml.Spreadsheet;

0 commit comments

Comments
 (0)