Skip to content

Commit

Permalink
Merge pull request #49 from dotnet-campus/t/wzd/UpdateUnitOpenxmlSdk
Browse files Browse the repository at this point in the history
将单位转换库升级OpenXml Sdk升级到3.2.0
  • Loading branch information
lindexi authored Dec 19, 2024
2 parents 290d977 + 2ff586e commit 8d14346
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/dotnetCampus.OpenXMLUnitConverter/MillisecondTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public MillisecondTime(StringValue? millisecond)
Milliseconds = value;
IsIndefinite = false;
}
else if (Enum.TryParse<IndefiniteTimeDeclarationValues>(millisecond, true, out var result)
&& result == IndefiniteTimeDeclarationValues.Indefinite)
else if (new IndefiniteTimeDeclarationValues(millisecond) == IndefiniteTimeDeclarationValues.Indefinite)
{
Milliseconds = long.MaxValue;
IsIndefinite = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.13.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.2.0" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public void ParseMillisecondTimeText()

"传入未定义的 OpenXML 字符串,可以说明未解析".Test(() =>
{
var stringValue = new StringValue(IndefiniteTimeDeclarationValues.Indefinite.ToString());
var indefinite = (IEnumValue)IndefiniteTimeDeclarationValues.Indefinite;
var stringValue = new StringValue(indefinite.Value);
var millisecondTime = new MillisecondTime(stringValue);
Assert.AreEqual(true, millisecondTime.IsIndefinite);
});
Expand Down

0 comments on commit 8d14346

Please sign in to comment.