Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/system.text.json #156

Merged
merged 10 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Bitfinex.Net.UnitTests/Bitfinex.Net.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<packagereference Include="Microsoft.NET.Test.Sdk" Version="16.10.0"></packagereference>
<PackageReference Include="Moq" Version="4.16.1" />
<packagereference Include="NUnit" Version="3.13.2"></packagereference>
<packagereference Include="NUnit3TestAdapter" Version="3.17.0"></packagereference>
<packagereference Include="Microsoft.NET.Test.Sdk" Version="17.9.0"></packagereference>
<PackageReference Include="Moq" Version="4.20.70" />
<packagereference Include="NUnit" Version="4.1.0"></packagereference>
<packagereference Include="NUnit3TestAdapter" Version="4.5.0"></packagereference>
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 8 additions & 7 deletions Bitfinex.Net.UnitTests/BitfinexClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Bitfinex.Net.Clients;
using Bitfinex.Net.ExtensionMethods;
using CryptoExchange.Net.Objects.Sockets;
using NUnit.Framework.Legacy;

namespace Bitfinex.Net.UnitTests
{
Expand All @@ -31,9 +32,9 @@ public async Task ReceivingHttpError_Should_ResultInErrorResult()
var result = await client.SpotApi.ExchangeData.GetAssetFullNamesAsync();

// assert
Assert.AreEqual(false, result.Success);
Assert.IsTrue(result.Error.ToString().Contains("Error message"));
Assert.AreEqual(HttpStatusCode.BadRequest, result.ResponseStatusCode);
Assert.That(false == result.Success);
Assert.That(result.Error.ToString().Contains("Error message"));
Assert.That(HttpStatusCode.BadRequest == result.ResponseStatusCode);
}


Expand All @@ -45,7 +46,7 @@ public void ProvidingApiCredentials_Should_SaveApiCredentials()
var authProvider = new BitfinexAuthenticationProvider(new ApiCredentials("TestKey", "TestSecret"), null);

// assert
Assert.AreEqual(authProvider.GetApiKey(), "TestKey");
Assert.That(authProvider.GetApiKey() == "TestKey");
}

[Test]
Expand All @@ -58,7 +59,7 @@ public void SigningString_Should_ReturnCorrectString()
string signed = authProvider.Sign("SomeTestString");

// assert
Assert.AreEqual(signed, "9052C73092B21B945BC5859CADBA6A5658E142F021FCB092A72F68E8A0D5E6351CFEBAE52DB9067D4360F796CB520960");
Assert.That(signed == "9052C73092B21B945BC5859CADBA6A5658E142F021FCB092A72F68E8A0D5E6351CFEBAE52DB9067D4360F796CB520960");
}

[Test]
Expand Down Expand Up @@ -112,7 +113,7 @@ public void CheckRestInterfaces()
foreach (var method in implementation.GetMethods().Where(m => m.ReturnType.IsAssignableTo(typeof(Task))))
{
var interfaceMethod = clientInterface.GetMethod(method.Name, method.GetParameters().Select(p => p.ParameterType).ToArray());
Assert.NotNull(interfaceMethod, $"Missing interface for method {method.Name} in {implementation.Name} implementing interface {clientInterface.Name}");
ClassicAssert.NotNull(interfaceMethod, $"Missing interface for method {method.Name} in {implementation.Name} implementing interface {clientInterface.Name}");
methods++;
}
Debug.WriteLine($"{clientInterface.Name} {methods} methods validated");
Expand All @@ -132,7 +133,7 @@ public void CheckSocketInterfaces()
foreach (var method in implementation.GetMethods().Where(m => m.ReturnType.IsAssignableTo(typeof(Task<CallResult<UpdateSubscription>>))))
{
var interfaceMethod = clientInterface.GetMethod(method.Name, method.GetParameters().Select(p => p.ParameterType).ToArray());
Assert.NotNull(interfaceMethod, $"Missing interface for method {method.Name} in {implementation.Name} implementing interface {clientInterface.Name}");
ClassicAssert.NotNull(interfaceMethod, $"Missing interface for method {method.Name} in {implementation.Name} implementing interface {clientInterface.Name}");
methods++;
}
Debug.WriteLine($"{clientInterface.Name} {methods} methods validated");
Expand Down
Loading
Loading