Files
ClosedXML/ClosedXML_Tests/Utils/ExcelDocsComparer.cs
T
Thom Lamb 2cd6df6481 Initial commit of the ClosedXML library
Establishes the foundational structure, core Excel functionality, and tooling.

- Implements base components for cells, ranges, columns, and rows.
- Integrates a custom calculation engine with a wide range of Excel functions.
- Adds comprehensive support for styling, conditional formatting, data validation, comments, pictures, and charts.
- Configures build setup, project metadata (NuGet), and developer guidelines.
- Includes editor and Git attributes for consistent code style and line endings.
2026-06-23 11:02:53 -05:00

39 lines
1.2 KiB
C#

using System;
using System.IO;
using System.IO.Packaging;
namespace ClosedXML_Tests
{
internal static class ExcelDocsComparer
{
public static bool Compare(string left, string right, out string message)
{
using (FileStream leftStream = File.OpenRead(left))
using (FileStream rightStream = File.OpenRead(right))
{
return Compare(leftStream, rightStream, out message);
}
}
public static bool Compare(Stream left, Stream right, out string message)
{
using (Package leftPackage = Package.Open(left, FileMode.Open, FileAccess.Read))
using (Package rightPackage = Package.Open(right, FileMode.Open, FileAccess.Read))
{
return PackageHelper.Compare(leftPackage, rightPackage, false, ExcludeMethod, out message);
}
}
private static bool ExcludeMethod(Uri uri)
{
//Exclude service data
if (uri.OriginalString.EndsWith(".rels") ||
uri.OriginalString.EndsWith(".psmdcp"))
{
return true;
}
return false;
}
}
}