forked from ClosedXML/ClosedXML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenXmlTests.cs
30 lines (28 loc) · 962 Bytes
/
OpenXmlTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using DocumentFormat.OpenXml.Packaging;
using NUnit.Framework;
using System.IO;
namespace ClosedXML.Tests
{
[TestFixture]
public class OpenXmlTests
{
[Test]
[Ignore("Workaround has been included in ClosedXML")]
public static void SetPackagePropertiesEntryToNullWithOpenXml()
{
// Fixed in .NET Standard 2.1
// See:
// https://github.com/OfficeDev/Open-XML-SDK/issues/235
// https://github.com/dotnet/corefx/issues/23795
using (var stream = TestHelper.GetStreamFromResource(TestHelper.GetResourcePath(@"Examples\PivotTables\PivotTables.xlsx")))
using (var ms = new MemoryStream())
{
stream.CopyTo(ms);
using (var document = SpreadsheetDocument.Open(ms, true))
{
document.PackageProperties.Creator = null;
}
}
}
}
}