Skip to content

Commit 462c654

Browse files
authored
chore(deps): migrate to xunit.v3 (#624)
1 parent b5601a2 commit 462c654

File tree

7 files changed

+21
-24
lines changed

7 files changed

+21
-24
lines changed

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<PropertyGroup Label="Build">
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
8+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
89
</PropertyGroup>
910

1011
<PropertyGroup Label="Signing">

test/Directory.Build.props

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22

33
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
44

5-
<ItemGroup Label="Package References">
5+
<PropertyGroup Label="Build">
6+
<TargetFramework>net9.0</TargetFramework>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup Label="Package References" Condition="'$(OutputType)' == 'Exe'">
611
<PackageReference Include="CaseExtensions" Version="1.1.0"/>
712
<PackageReference Include="coverlet.collector" PrivateAssets="all" Version="6.0.2">
813
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
914
</PackageReference>
1015
<PackageReference Include="FluentAssertions" Version="7.0.0"/>
1116
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
1217
<PackageReference Include="Moq" Version="4.20.72"/>
13-
<PackageReference Include="xunit" Version="2.9.2"/>
18+
<PackageReference Include="xunit.v3" Version="1.0.0"/>
1419
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" Version="3.0.0">
1520
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1621
</PackageReference>

test/Octokit.Webhooks.AzureFunctions.Test/Octokit.Webhooks.AzureFunctions.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup Label="Build">
4-
<TargetFramework>net9.0</TargetFramework>
4+
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

77
<ItemGroup Label="Project References">

test/Octokit.Webhooks.Test/Octokit.Webhooks.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup Label="Build">
4-
<TargetFramework>net9.0</TargetFramework>
4+
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

77
<ItemGroup Label="Project References">

test/Octokit.Webhooks.Test/WebhookEventProcessorTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ public class WebhookEventProcessorTests
1010

1111
[Theory]
1212
[ClassData(typeof(WebhookEventProcessorTestsData))]
13-
public void CanDeserialize(WebhookHeaders headers, string payload, Type expectedType)
13+
public void CanDeserialize(string @event, string payload, Type expectedType)
1414
{
15+
var headers = new WebhookHeaders
16+
{
17+
Event = @event,
18+
};
1519
var result = this.webhookEventProcessor.DeserializeWebhookEvent(headers, payload);
1620
result.Should().BeAssignableTo(expectedType);
1721
}

test/Octokit.Webhooks.Test/WebhookEventProcessorTestsData.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
namespace Octokit.Webhooks.Test;
22

3+
using System;
34
using System.Collections;
45
using System.Collections.Generic;
56
using System.IO;
67
using CaseExtensions;
78
using Octokit.Webhooks.TestUtils;
9+
using Xunit;
810

9-
public class WebhookEventProcessorTestsData : IEnumerable<object[]>
11+
public class WebhookEventProcessorTestsData : IEnumerable<TheoryDataRow<string, string, Type>>
1012
{
11-
public IEnumerator<object[]> GetEnumerator()
13+
public IEnumerator<TheoryDataRow<string, string, Type>> GetEnumerator()
1214
{
1315
var resourcesDirectory = ResourceUtils.GetResources();
1416
var files = Directory.GetFiles(resourcesDirectory, "*.json", SearchOption.AllDirectories);
1517
foreach (var file in files)
1618
{
1719
var relativeResource = file.Replace($"{resourcesDirectory}{Path.DirectorySeparatorChar}", string.Empty);
1820
var parts = relativeResource.Split(Path.DirectorySeparatorChar);
19-
var headers = new WebhookHeaders
20-
{
21-
Event = parts[0],
22-
};
2321
var expectedType = ClassUtils.GetEventTypeByName(parts[0].ToPascalCase());
2422
var content = ResourceUtils.ReadResource(relativeResource);
25-
yield return new object[]
26-
{
27-
headers,
28-
content,
29-
expectedType,
30-
};
23+
yield return new TheoryDataRow<string, string, Type>(parts[0], content, expectedType);
3124
}
3225
}
3326

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup Label="Build">
4-
<TargetFramework>net9.0</TargetFramework>
5-
</PropertyGroup>
6-
7-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk"/>

0 commit comments

Comments
 (0)