Skip to content

Commit 1348eb4

Browse files
authored
Merge pull request #17 from pactflow/deps/pact_net_5_dotnet_8
chore(deps):pact-net 5/dotnet8
2 parents e6c73e7 + fb14fe8 commit 1348eb4

File tree

10 files changed

+53
-89
lines changed

10 files changed

+53
-89
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
dotnet-version: ["6.0.x"]
20+
dotnet-version: ["8.0.x"]
2121
pact_provider:
2222
[
2323
# "pactflow-example-bi-directional-provider-dredd",
@@ -27,9 +27,9 @@ jobs:
2727
'pactflow-provider-dotnet'
2828
]
2929
steps:
30-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
3131
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
32-
uses: actions/setup-dotnet@v3.0.3
32+
uses: actions/setup-dotnet@v4
3333
with:
3434
dotnet-version: ${{ matrix.dotnet-version }}
3535
- name: test for ${{ matrix.pact_provider }}
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
needs: test
4949
steps:
50-
- uses: actions/checkout@v2
50+
- uses: actions/checkout@v4
5151
- run: docker pull pactfoundation/pact-cli:latest
5252
- name: Can I deploy?
5353
run: GIT_BRANCH=${GITHUB_REF:11} make can_i_deploy
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: ubuntu-latest
5858
needs: can-i-deploy
5959
steps:
60-
- uses: actions/checkout@v2
60+
- uses: actions/checkout@v4
6161
- run: docker pull pactfoundation/pact-cli:latest
6262
- name: Deploy
6363
run: GIT_BRANCH=${GITHUB_REF:11} make deploy

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode/
22
bin/
33
obj/
4-
.DS_Store
4+
.DS_Store
5+
pacts/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ can_i_deploy:
6363
--pacticipant ${PACTICIPANT} \
6464
--version ${GIT_COMMIT} \
6565
--to-environment production \
66-
--retry-while-unknown 0 \
66+
--retry-while-unknown 5 \
6767
--retry-interval 10
6868

6969
deploy_app:

example-consumer-dotnet.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tests", "tests\tests.csproj", "{306D0F6E-3E74-4F08-B888-0D1EA31A4A79}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "consumer", "src\consumer.csproj", "{2B3F7070-3C38-4B13-A8F7-A09FFF6D4299}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{306D0F6E-3E74-4F08-B888-0D1EA31A4A79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{306D0F6E-3E74-4F08-B888-0D1EA31A4A79}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{306D0F6E-3E74-4F08-B888-0D1EA31A4A79}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{306D0F6E-3E74-4F08-B888-0D1EA31A4A79}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{2B3F7070-3C38-4B13-A8F7-A09FFF6D4299}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{2B3F7070-3C38-4B13-A8F7-A09FFF6D4299}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{2B3F7070-3C38-4B13-A8F7-A09FFF6D4299}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{2B3F7070-3C38-4B13-A8F7-A09FFF6D4299}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {3BD4D93A-EFC4-4ED1-B541-9D6E57B626E8}
30+
EndGlobalSection
31+
EndGlobal

pacts/pactflow-example-consumer-dotnet-pactflow-example-provider-dotnet.json

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/ConsumerApiClient.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Net.Http;
43
using System.Threading.Tasks;
5-
using Newtonsoft.Json;
4+
using System.Text.Json;
65

76
namespace Consumer
87
{
98
public struct Product
109
{
11-
public string id;
12-
public string type;
13-
public string name;
10+
public string id { get; set; }
11+
public string type { get; set; }
12+
public string name { get; set; }
1413
}
1514

1615
public class ProductClient
@@ -25,7 +24,7 @@ public class ProductClient
2524

2625
var resp = await response.Content.ReadAsStringAsync();
2726

28-
return JsonConvert.DeserializeObject<List<Product>>(resp);
27+
return JsonSerializer.Deserialize<List<Product>>(resp);
2928
}
3029
}
3130
}

src/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Net.Http;
4-
using System.Threading.Tasks;
53

64
namespace Consumer
75
{

src/consumer.csproj

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
10-
</ItemGroup>
11-
12-
<ItemGroup>
13-
<PackageReference Include="FluentAssertions" Version="5.10.3" />
9+
<PackageReference Include="FluentAssertions" Version="6.12.1" />
1410
</ItemGroup>
1511

1612
</Project>

tests/ConsumerPactTests.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.IO;
32
using Xunit;
43
using Xunit.Abstractions;
@@ -17,9 +16,7 @@ namespace tests
1716
{
1817
public class ConsumerPactTests
1918
{
20-
private IPactBuilderV3 pact;
21-
// private readonly int port = 9222;
22-
19+
private readonly IPactBuilderV4 pact;
2320
private readonly List<object> products;
2421

2522
public ConsumerPactTests(ITestOutputHelper output)
@@ -37,7 +34,7 @@ public ConsumerPactTests(ITestOutputHelper output)
3734
LogLevel = PactLogLevel.Debug
3835
};
3936

40-
pact = Pact.V3("pactflow-example-consumer-dotnet", "pactflow-example-provider-dotnet", Config).WithHttpInteractions();
37+
pact = Pact.V4("pactflow-example-consumer-dotnet", "pactflow-example-provider-dotnet", Config).WithHttpInteractions();
4138
}
4239

4340
[Fact]

tests/tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
@@ -11,11 +11,11 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
15-
<PackageReference Include="PactNet" Version="4.5.0" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
15+
<PackageReference Include="PactNet" Version="5.0.0" />
1616
<PackageReference Include="PactNet.Output.Xunit" Version="1.0.0" />
17-
<PackageReference Include="xunit" Version="2.4.1" />
18-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"/>
17+
<PackageReference Include="xunit" Version="2.9.2" />
18+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"/>
1919
</ItemGroup>
2020
<ItemGroup>
2121
<None Remove="XUnitHelpers\" />

0 commit comments

Comments
 (0)