Skip to content

Commit 603647a

Browse files
authored
update projects to .net 8.0 (#822)
- updated dependencies in `ExchangeSharpTests` - fix compilation errors in `ExchangeSharpTests` and `ExchangeBitflyerApi.cs`
1 parent 963eb37 commit 603647a

File tree

7 files changed

+21
-32
lines changed

7 files changed

+21
-32
lines changed

examples/ExchangeSharpWinForms/ExchangeSharpWinForms.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<ProjectGuid>{571623F9-1652-4669-8E17-A6FAD1426181}</ProjectGuid>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net6.0-windows</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
77
<AssemblyTitle>ExchangeSharpWinForms</AssemblyTitle>
88
<Product>ExchangeSharpWinForms</Product>

src/ExchangeSharp.Forms/ExchangeSharp.Forms.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>
4-
<TargetFramework>net6.0-windows</TargetFramework>
4+
<TargetFramework>net8.0-windows</TargetFramework>
55
<DefineConstants>HAS_WINDOWS_FORMS</DefineConstants>
66
<NeutralLanguage>en</NeutralLanguage>
77
<UseWindowsForms>true</UseWindowsForms>

src/ExchangeSharp/API/Exchanges/Bitflyer/ExchangeBitflyerApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ await client.socketIO.EmitAsync(
161161

162162
class SocketIOWrapper : IWebSocket
163163
{
164-
public SocketIO socketIO;
164+
public SocketIOClient.SocketIO socketIO;
165165

166166
public SocketIOWrapper(string url)
167167
{
168-
socketIO = new SocketIO(url);
168+
socketIO = new SocketIOClient.SocketIO(url);
169169
socketIO.Options.Transport = SocketIOClient.Transport.TransportProtocol.WebSocket;
170170
socketIO.OnConnected += (s, e) => Connected?.Invoke(this);
171171
socketIO.OnDisconnected += (s, e) => Disconnected?.Invoke(this);

src/ExchangeSharpConsole/ExchangeSharpConsole.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<AssemblyName>exchange-sharp</AssemblyName>
6-
<TargetFramework>net6.0</TargetFramework>
6+
<TargetFramework>net8.0</TargetFramework>
77
<NeutralLanguage>en</NeutralLanguage>
88
<AssemblyVersion>1.0.4</AssemblyVersion>
99
<FileVersion>1.0.4</FileVersion>

tests/ExchangeSharpTests/ExchangeCoinbaseAPITests.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using ExchangeSharp;
7-
using ExchangeSharp.Coinbase;
87
using FluentAssertions;
98
using Microsoft.VisualStudio.TestTools.UnitTesting;
109
using Newtonsoft.Json;
@@ -27,21 +26,5 @@ await ExchangeAPI.GetExchangeAPIAsync(ExchangeName.Coinbase) as ExchangeCoinbase
2726
api.RequestMaker = requestMaker;
2827
return api;
2928
}
30-
31-
[TestMethod]
32-
public void DeserializeUserMatch()
33-
{
34-
string toParse =
35-
"{\r\n \"type\": \"match\",\r\n \"trade_id\": 10,\r\n \"sequence\": 50,\r\n \"maker_order_id\": \"ac928c66-ca53-498f-9c13-a110027a60e8\",\r\n \"taker_order_id\": \"132fb6ae-456b-4654-b4e0-d681ac05cea1\",\r\n \"time\": \"2014-11-07T08:19:27.028459Z\",\r\n \"product_id\": \"BTC-USD\",\r\n \"size\": \"5.23512\",\r\n \"price\": \"400.23\",\r\n \"side\": \"sell\"\r\n,\r\n \"taker_user_id\": \"5844eceecf7e803e259d0365\",\r\n \"user_id\": \"5844eceecf7e803e259d0365\",\r\n \"taker_profile_id\": \"765d1549-9660-4be2-97d4-fa2d65fa3352\",\r\n \"profile_id\": \"765d1549-9660-4be2-97d4-fa2d65fa3352\",\r\n \"taker_fee_rate\": \"0.005\"\r\n}";
36-
37-
var usermatch = JsonConvert.DeserializeObject<Match>(
38-
toParse,
39-
BaseAPI.SerializerSettings
40-
);
41-
usermatch.MakerOrderId.Should().Be("ac928c66-ca53-498f-9c13-a110027a60e8");
42-
usermatch.ExchangeOrderResult.OrderId
43-
.Should()
44-
.Be("132fb6ae-456b-4654-b4e0-d681ac05cea1");
45-
}
4629
}
4730
}

tests/ExchangeSharpTests/ExchangePoloniexAPITests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public async Task GetOrderDetails_OrderNotFound_DoesNotThrow()
285285
@"{""error"":""Order not found, or you are not the person who placed it.""}";
286286
var polo = await CreatePoloniexAPI(response);
287287
async Task a() => await polo.GetOrderDetailsAsync("1");
288-
Invoking(a).Should().Throw<APIException>();
288+
await Invoking(a).Should().ThrowAsync<APIException>();
289289
}
290290

291291
[TestMethod]
@@ -295,7 +295,7 @@ public async Task GetOrderDetails_OtherErrors_ThrowAPIException()
295295
var polo = await CreatePoloniexAPI(response);
296296

297297
async Task a() => await polo.GetOrderDetailsAsync("1");
298-
Invoking(a).Should().Throw<APIException>();
298+
await Invoking(a).Should().ThrowAsync<APIException>();
299299
}
300300

301301
[TestMethod]

tests/ExchangeSharpTests/ExchangeSharpTests.csproj

Lines changed: 14 additions & 8 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
<IsPackable>false</IsPackable>
66
<NeutralLanguage>en</NeutralLanguage>
77
<AssemblyVersion>1.0.4</AssemblyVersion>
@@ -17,13 +17,19 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="FluentAssertions" Version="5.2.0" />
21-
<PackageReference Include="FluentAssertions.Analyzers" Version="0.11.4" />
22-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
23-
<PackageReference Include="MSTest.TestAdapter" Version="1.2.1" />
24-
<PackageReference Include="MSTest.TestFramework" Version="1.2.1" />
25-
<PackageReference Include="NSubstitute" Version="3.1.0" />
26-
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.10" />
20+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
21+
<PackageReference Include="FluentAssertions.Analyzers" Version="0.29.0">
22+
<PrivateAssets>all</PrivateAssets>
23+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24+
</PackageReference>
25+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
26+
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
27+
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
28+
<PackageReference Include="NSubstitute" Version="5.1.0" />
29+
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
30+
<PrivateAssets>all</PrivateAssets>
31+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32+
</PackageReference>
2733
</ItemGroup>
2834

2935
<ItemGroup>

0 commit comments

Comments
 (0)