-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CryptoExchange.Net testing update (#162)
- Loading branch information
Showing
7 changed files
with
96 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Bitfinex.Net.UnitTests/Endpoints/Spot/ExchangeData/GetPlatformStatus.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
GET | ||
/v2/platform/status | ||
false | ||
[ | ||
1 //STATUS | ||
] |
18 changes: 18 additions & 0 deletions
18
Bitfinex.Net.UnitTests/Endpoints/Spot/ExchangeData/GetTickers.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
GET | ||
/v2/tickers | ||
false | ||
[ | ||
[ | ||
"tBTCUSD", //SYMBOL | ||
10645, //BID | ||
73.93854271, //BID_SIZE | ||
10647, //ASK | ||
75.22266119, //ASK_SIZE | ||
731.60645389, //DAILY_CHANGE | ||
0.0738, //DAILY_CHANGE_RELATIVE | ||
10644.00645389, //LAST_PRICE | ||
14480.89849423, //VOLUME | ||
10766, //HIGH | ||
9889.1449809 //LOW | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
using CryptoExchange.Net.Authentication; | ||
using CryptoExchange.Net.Objects; | ||
using Bitfinex.Net.Clients; | ||
using CryptoExchange.Net.Testing; | ||
|
||
namespace Bitfinex.Net.UnitTests | ||
{ | ||
[TestFixture] | ||
public class RestRequestTests | ||
{ | ||
[Test] | ||
public async Task ValidateSpotExchangeDataCalls() | ||
{ | ||
var client = new BitfinexRestClient(opts => | ||
{ | ||
opts.AutoTimestamp = false; | ||
opts.ApiCredentials = new ApiCredentials("123", "456"); | ||
}); | ||
var tester = new RestRequestValidator<BitfinexRestClient>(client, "Endpoints/Spot/ExchangeData", "https://api.bitfinex.com", IsAuthenticated, stjCompare: false); | ||
await tester.ValidateAsync(client => client.SpotApi.ExchangeData.GetTickersAsync(), "GetTickers"); | ||
await tester.ValidateAsync(client => client.SpotApi.ExchangeData.GetPlatformStatusAsync(), "GetPlatformStatus"); | ||
} | ||
|
||
private bool IsAuthenticated(WebCallResult result) | ||
{ | ||
return result.RequestUrl.Contains("bfx-signature"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters