Skip to content

Commit

Permalink
Update XUnit to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
twsouthwick committed Jan 6, 2025
1 parent 89cd570 commit adada34
Show file tree
Hide file tree
Showing 59 changed files with 634 additions and 719 deletions.
18 changes: 9 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<NoWarn>$(NoWarn);CS1685</NoWarn>
<ProductTargetFrameworks>net35</ProductTargetFrameworks>
<FrameworkTargetFrameworks>net35</FrameworkTargetFrameworks>
<TestTargetFrameworks>net462</TestTargetFrameworks>
<AssetsTargetFrameworks>net462</AssetsTargetFrameworks>
<LatestTargetFramework>net462</LatestTargetFramework>
<TestTargetFrameworks>net472</TestTargetFrameworks>
<AssetsTargetFrameworks>net472</AssetsTargetFrameworks>
<LatestTargetFramework>net472</LatestTargetFramework>
<SamplesFrameworks>net472</SamplesFrameworks>
</PropertyGroup>
</When>
Expand All @@ -53,22 +53,22 @@
<NoWarn>$(NoWarn);CS1685</NoWarn>
<ProductTargetFrameworks>net40</ProductTargetFrameworks>
<FrameworkTargetFrameworks>net40</FrameworkTargetFrameworks>
<TestTargetFrameworks>net462</TestTargetFrameworks>
<AssetsTargetFrameworks>net462</AssetsTargetFrameworks>
<LatestTargetFramework>net462</LatestTargetFramework>
<TestTargetFrameworks>net472</TestTargetFrameworks>
<AssetsTargetFrameworks>net472</AssetsTargetFrameworks>
<LatestTargetFramework>net472</LatestTargetFramework>
<SamplesFrameworks>net472</SamplesFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<ProductTargetFrameworks>netstandard2.0;net8.0;net35;net40;net46</ProductTargetFrameworks>
<FrameworkTargetFrameworks>netstandard2.0;net6.0;net8.0;net35;net40;net46</FrameworkTargetFrameworks>
<AssetsTargetFrameworks>netstandard2.0;net462</AssetsTargetFrameworks>
<AssetsTargetFrameworks>netstandard2.0;net472</AssetsTargetFrameworks>
<TestTargetFrameworks>net8.0</TestTargetFrameworks>
<TestTargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net462</TestTargetFrameworks>
<TestTargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net472</TestTargetFrameworks>
<LatestTargetFramework>net8.0</LatestTargetFramework>
<SamplesFrameworks>net8.0</SamplesFrameworks>
<SamplesFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net472</SamplesFrameworks>
<SamplesFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(SamplesFrameworks);net472</SamplesFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
Expand Down
4 changes: 1 addition & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Microsoft.DotNet.BuildTools.GenAPI" Version="3.0.0-preview4-06015-01" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
Expand All @@ -30,7 +29,6 @@
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Xml.ReaderWriter" Version="4.3.1" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.v3" Version="1.0.0" />
</ItemGroup>
</Project>
7 changes: 0 additions & 7 deletions Open-XML-SDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{3653266D-2C8
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentFormat.OpenXml.Generator", "gen\DocumentFormat.OpenXml.Generator\DocumentFormat.OpenXml.Generator.csproj", "{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentFormat.OpenXml.Generator.Tests", "test\DocumentFormat.OpenXml.Generator.Tests\DocumentFormat.OpenXml.Generator.Tests.csproj", "{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linq", "Linq", "{C5AE39F0-A152-471A-B90E-B8F4E94AA6C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SvgExampleLinq", "samples\Linq\SvgExample\SvgExampleLinq.csproj", "{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}"
Expand Down Expand Up @@ -149,10 +147,6 @@ Global
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}.Release|Any CPU.Build.0 = Release|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Release|Any CPU.Build.0 = Release|Any CPU
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -211,7 +205,6 @@ Global
{E157C5F1-D70B-4939-A199-0B758FED8541} = {0782A132-968D-4BDD-911A-2C3074EAF886}
{3B82C340-3B10-42BF-9A2C-2E2327A9CFD4} = {0782A132-968D-4BDD-911A-2C3074EAF886}
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385} = {3653266D-2C88-4487-8977-839CB3E78A0A}
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62} = {0782A132-968D-4BDD-911A-2C3074EAF886}
{C5AE39F0-A152-471A-B90E-B8F4E94AA6C2} = {7DAF7304-40CC-4180-88A5-9A89DD13C565}
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01} = {7DAF7304-40CC-4180-88A5-9A89DD13C565}
{890B74DD-6316-4D56-B42A-5D66F10F88C6} = {C5AE39F0-A152-471A-B90E-B8F4E94AA6C2}
Expand Down
2 changes: 1 addition & 1 deletion test/Common/ITestOutputHelperExtenstions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.IO;
using Xunit.Abstractions;
using Xunit;

namespace DocumentFormat.OpenXml.Tests
{
Expand Down
1 change: 0 additions & 1 deletion test/Common/VerifiableLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using System;
using Xunit;
using Xunit.Abstractions;

namespace LogUtil
{
Expand Down
15 changes: 0 additions & 15 deletions test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@
<Link>Common/$([MSBuild]::MakeRelative($(CommonFilesDirectory), %(FullPath)))</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.ValueTuple" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</When>
</Choose>
<Target Name="PublishProjectIfFrameworkSet" DependsOnTargets="Publish" Condition=" '$(TargetFramework)' != '' " />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml\DocumentFormat.OpenXml.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<IsTestProject>true</IsTestProject>
<Nullable>enable</Nullable>
<IncludeFrameworkShims>true</IncludeFrameworkShims>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +16,11 @@
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml.Features\DocumentFormat.OpenXml.Features.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NSubstitute" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>$(TestTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,4 +25,11 @@
<ProjectReference Include="..\DocumentFormat.OpenXml.Tests.Assets\DocumentFormat.OpenXml.Tests.Assets.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NSubstitute" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Linq;
using System.Reflection;
using Xunit;
using Xunit.Abstractions;

using static DocumentFormat.OpenXml.Framework.Tests.TestUtility;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Collections.Generic;
using System.Xml;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Framework.Tests;

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
<TargetFrameworks>$(TestTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml.Linq\DocumentFormat.OpenXml.Linq.csproj" />
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml\DocumentFormat.OpenXml.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(TestTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,4 +23,9 @@
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.v3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.Linq;
using System.Reflection;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System.Linq;
using System.Reflection;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Packaging.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<PropertyGroup>
<TargetFrameworks>$(AssetsTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);CA1822;CA1034</NoWarn>
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="assets\**\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" />
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions test/DocumentFormat.OpenXml.Tests.Assets/TestAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Xunit;

namespace DocumentFormat.OpenXml.Tests
{
Expand Down Expand Up @@ -51,7 +50,10 @@ public static Stream GetStream(string name)
var stream = assembly.GetManifestResourceStream($"DocumentFormat.OpenXml.Tests.Assets.assets.{name}");
var names = assembly.GetManifestResourceNames().OrderBy(t => t).ToList();

Assert.NotNull(stream);
if (stream is null)
{
throw new InvalidOperationException($"Could not find stream '{name}' for test");
}

return stream;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using DocumentFormat.OpenXml.Tests.ChartTrackingRefBasedClass;
using System.IO;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests.ChartTrackingRefBased
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void CommentExInvalidFormat()
using (var doc = WordprocessingDocument.Open(stream, false))
{
var validator = new OpenXmlValidator(FileFormatVersions.Office2013);
var validateResults = validator.Validate(doc);
var validateResults = validator.Validate(doc, TestContext.Current.CancellationToken);

Assert.Empty(validateResults);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using DocumentFormat.OpenXml.Tests.CommentExPeopleClass;
using System.IO;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests.CommentExPeople
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.IO;
using System.Linq;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests.ContentControl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Tests.FootnoteColumnsClass;
using Xunit;
using Xunit.Abstractions;

using W15 = DocumentFormat.OpenXml.Office2013.Word;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Xunit.Abstractions;
using Xunit;

namespace DocumentFormat.OpenXml.Tests
{
Expand Down
Loading

0 comments on commit adada34

Please sign in to comment.