Skip to content

Commit a530ce9

Browse files
authored
Upgrade to ClosedXML 0.101 (#321)
* Upgrade to ClosedXML 0.101; target netstandard2.0 and netstandard2.1 * Fix test that started to fail after upgrading calc engine in ClosedXML; make the test culture-independent
1 parent c06aae2 commit a530ce9

File tree

4 files changed

+9
-36
lines changed

4 files changed

+9
-36
lines changed

ClosedXML.Report/ClosedXML.Report.csproj

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net462;net6.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
55
<LangVersion>10</LangVersion>
66
<AssemblyName>ClosedXML.Report</AssemblyName>
77
<PackageId>ClosedXML.Report</PackageId>
88
<Configurations>Debug;Release</Configurations>
9-
<PackageLicenseUrl></PackageLicenseUrl>
109
<PackageProjectUrl>https://github.com/ClosedXML/ClosedXML.Report</PackageProjectUrl>
1110
<RepositoryUrl>https://github.com/ClosedXML/ClosedXML.Report</RepositoryUrl>
12-
<Authors>Alexey Rozhkov</Authors>
11+
<Authors>Alexey Rozhkov, Alexey Pankratev</Authors>
1312
<Copyright>MIT</Copyright>
1413
<Product>ClosedXML.Report</Product>
1514
<PackageReleaseNotes>See https://github.com/ClosedXML/ClosedXML.Report/releases/tag/$(productVersion)</PackageReleaseNotes>
@@ -37,20 +36,9 @@
3736
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
3837
</PropertyGroup>
3938

40-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
41-
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
42-
</PropertyGroup>
43-
44-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
45-
<DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants>
46-
</PropertyGroup>
47-
48-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
49-
<DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants>
50-
</PropertyGroup>
51-
5239
<ItemGroup>
53-
<PackageReference Include="ClosedXML" Version="0.100.3" />
40+
<PackageReference Include="ClosedXML" Version="0.101.0" />
41+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
5442
<PackageReference Include="morelinq" Version="3.4.1" />
5543
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.0" />
5644
</ItemGroup>

tests/ClosedXML.Report.Tests/ClosedXML.Report.Tests.csproj

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
3+
<TargetFramework>net6.0</TargetFramework>
44
<LangVersion>10</LangVersion>
5-
<Configurations>Debug;Release</Configurations>
6-
<PackageLicenseUrl>https://github.com/ClosedXML/ClosedXML.Report/blob/master/LICENSE</PackageLicenseUrl>
7-
<PackageProjectUrl>https://github.com/ClosedXML/ClosedXML.Report</PackageProjectUrl>
8-
<RepositoryUrl>https://github.com/ClosedXML/ClosedXML.Report</RepositoryUrl>
9-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
10-
<Authors>Alexey Rozhkov</Authors>
11-
<Copyright>MIT</Copyright>
12-
<Version>0.1.0.0</Version>
135
<SignAssembly>true</SignAssembly>
146
<AssemblyOriginatorKeyFile>ClosedXML.Report.snk</AssemblyOriginatorKeyFile>
157
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
168
</PropertyGroup>
179

18-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
19-
<PlatformTarget>AnyCPU</PlatformTarget>
20-
</PropertyGroup>
21-
2210
<ItemGroup>
2311
<Compile Remove="FiledBuilderTests.cs" />
2412
</ItemGroup>

tests/ClosedXML.Report.Tests/ReportOptionsTests.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ public void Hidden_option_should_hide_sheet()
2727
[Fact]
2828
public void OnlyValues_option_should_remove_formulas_on_sheet()
2929
{
30-
//TODO make tests culture-independent
31-
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ru-RU");
3230
XlTemplateTest("5_options.xlsx",
3331
tpl => { },
3432
wb =>
3533
{
3634
var worksheet = wb.Worksheet(1);
3735
worksheet.Cell("B3").HasFormula.Should().BeFalse();
38-
worksheet.Cell("B3").GetValue<string>().Should().Be("Begin at " + DateTime.Today.Subtract(TimeSpan.FromDays(7)).ToShortDateString());
36+
worksheet.Cell("B3").GetValue<string>().Should().Be("Begin at 19.01.2023");
3937
worksheet = wb.Worksheet(3);
4038
worksheet.Cell("B4").HasFormula.Should().BeFalse();
4139
worksheet.Cell("B4").GetValue<int>().Should().Be(10);
@@ -45,14 +43,13 @@ public void OnlyValues_option_should_remove_formulas_on_sheet()
4543
[Fact]
4644
public void ColsFit_option_should_FitWidth()
4745
{
48-
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ru-RU");
4946
XlTemplateTest("5_options.xlsx",
5047
tpl => { },
5148
wb =>
5249
{
5350
var worksheet = wb.Worksheet(1);
54-
worksheet.Column(4).Width.Should().BeApproximately(5.03, 0.01);
55-
worksheet.Column(5).Width.Should().BeApproximately(13.61, 0.01);
51+
worksheet.Column(4).Width.Should().BeApproximately(5.0, 0.01);
52+
worksheet.Column(5).Width.Should().BeApproximately(16.16, 0.01);
5653
});
5754
}
5855

tests/Templates/5_options.xlsx

1.54 KB
Binary file not shown.

0 commit comments

Comments
 (0)