Skip to content

Commit 29c52fb

Browse files
committed
Rewrite using OpenXML instead of EPPlus
1 parent 18dfaa2 commit 29c52fb

33 files changed

Lines changed: 907 additions & 121 deletions

src/ExcelWorksheetExtensions.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Program.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/git-diff-xlsx.sln

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.271
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "git-diff-xlsx", "git-diff-xlsx.csproj", "{77B1C34C-9048-4189-B551-5A63B71F51DA}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "git-diff-xlsx", "git-diff-xlsx\git-diff-xlsx.csproj", "{77B1C34C-9048-4189-B551-5A63B71F51DA}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "git-diff-xlsx.tests", "git-diff-xlsx.tests\git-diff-xlsx.tests.csproj", "{3EDA3B82-E0D9-4475-8DA9-D0AFE8F19AE2}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,8 +17,15 @@ Global
1517
{77B1C34C-9048-4189-B551-5A63B71F51DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{77B1C34C-9048-4189-B551-5A63B71F51DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{77B1C34C-9048-4189-B551-5A63B71F51DA}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{3EDA3B82-E0D9-4475-8DA9-D0AFE8F19AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{3EDA3B82-E0D9-4475-8DA9-D0AFE8F19AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{3EDA3B82-E0D9-4475-8DA9-D0AFE8F19AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{3EDA3B82-E0D9-4475-8DA9-D0AFE8F19AE2}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE
2127
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {950839B2-8CD7-4C63-B97F-4336A389044A}
30+
EndGlobalSection
2231
EndGlobal
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Sheet1
2+
File last edited by Mark Webb
3+
=================================
4+
Sheet: Sheet1 [ A1:C6 ]
5+
=================================
6+
A1: Id
7+
B1: Name
8+
C1: Cost
9+
A2: 1
10+
B2: Item 1
11+
C2: £3.99
12+
A3: 2
13+
B3: Item 2
14+
C3: £2.95
15+
A4: 3
16+
B4: Item 3
17+
C4: £6.50
18+
B6: TOTAL
19+
C6: £13.44 SUM(C2:C5)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Sheet1
2+
File last edited by Mark Webb
3+
=================================
4+
Sheet: Sheet1 [ A1:C6 ]
5+
=================================
6+
A1: Id
7+
B1: Name
8+
C1: Cost
9+
A2: 1
10+
B2: Item 1
11+
C2: 1.00
12+
A3: 2
13+
B3: Item 2
14+
C3: 2.95
15+
A4: 3
16+
B4: Item 3
17+
C4: 6.50
18+
19+
B6: TOTAL
20+
C6: 10.45 SUM(C2:C5)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Sheet1
2+
File last edited by Mark Webb
3+
=================================
4+
Sheet: Sheet1 [ A1:B2 ]
5+
=================================
6+
A1: 25
7+
B1: 2
8+
A2: 17.899999999999999
9+
B2: 9999000
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Sheet1
2+
File last edited by Mark Webb
3+
=================================
4+
Sheet: Sheet1 [ A1:A2 ]
5+
=================================
6+
A1: Test123
7+
A2: I am a text cell
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using System;
2+
using System.IO;
3+
using ApprovalTests;
4+
using ApprovalTests.Reporters;
5+
using NUnit.Framework;
6+
7+
namespace git_diff_xlsx.tests
8+
{
9+
[TestFixture]
10+
public class ExcelFilePrinterTests
11+
{
12+
[Test]
13+
[UseReporter(typeof(DiffReporter))]
14+
public void CanPrintPlainTextCellValues()
15+
{
16+
var sut = new ExcelFilePrinter();
17+
using(var input = new MemoryStream(Resources.SingleSheetWithPlainTextValues))
18+
using(var output = new StringWriter())
19+
{
20+
sut.Print(input, output);
21+
Approvals.Verify(output.ToString());
22+
}
23+
}
24+
25+
[Test]
26+
[UseReporter(typeof(DiffReporter))]
27+
public void CanPrintNumericCellValues()
28+
{
29+
var sut = new ExcelFilePrinter();
30+
using(var input = new MemoryStream(Resources.SingleSheetWithNumericValues))
31+
using(var output = new StringWriter())
32+
{
33+
sut.Print(input, output);
34+
Approvals.Verify(output.ToString());
35+
}
36+
}
37+
38+
[Test]
39+
[UseReporter(typeof(DiffReporter))]
40+
public void CanPrintCalculatedCellValues()
41+
{
42+
var sut = new ExcelFilePrinter();
43+
using(var input = new MemoryStream(Resources.SingleSheetWithCalculatedValues))
44+
using(var output = new StringWriter())
45+
{
46+
sut.Print(input, output);
47+
Approvals.Verify(output.ToString());
48+
}
49+
}
50+
51+
[Test]
52+
[UseReporter(typeof(DiffReporter))]
53+
public void CanPrintCalculatedAndFormattedCellValues()
54+
{
55+
var sut = new ExcelFilePrinter();
56+
using(var input = new MemoryStream(Resources.SingleSheetWithCalculatedAndFormattedValues))
57+
using(var output = new StringWriter())
58+
{
59+
sut.Print(input, output);
60+
Approvals.Verify(output.ToString());
61+
}
62+
}
63+
}
64+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("git-diff-xlsx.tests")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Summerhouse Software")]
12+
[assembly: AssemblyProduct("git-diff-xlsx")]
13+
[assembly: AssemblyCopyright("Copyright © Summerhouse Software 2016-2020")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("3eda3b82-e0d9-4475-8da9-d0afe8f19ae2")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)