-
-
Notifications
You must be signed in to change notification settings - Fork 374
/
Copy pathExchangeKrakenAPITests.cs
46 lines (40 loc) · 1.2 KB
/
ExchangeKrakenAPITests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Threading.Tasks;
using ExchangeSharp;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
namespace ExchangeSharpTests
{
[TestClass]
public sealed class ExchangeKrakenTests
{
private ExchangeKrakenAPI api;
[TestInitialize()]
public async Task Startup()
{
api = (
await ExchangeAPI.GetExchangeAPIAsync(ExchangeName.Kraken)
).As<ExchangeKrakenAPI>();
return;
}
[TestMethod]
public void ExtendResultsWithOrderDescrTest()
{
string toParse = "buy 58.00000000 ADAUSDT @ market";
var extendedOrder = api.ExtendResultsWithOrderDescr(new ExchangeOrderResult(), toParse);
extendedOrder.IsBuy.Should().BeTrue();
extendedOrder.Amount.Should().Be(58);
extendedOrder.MarketSymbol.Should().Be("ADAUSDT");
}
[TestMethod]
public void ExtendResultsWithOrderDescrAndPriceTest()
{
string toParse = "buy 0.001254 BTCUSDT @ limit 1000";
var extendedOrder = api.ExtendResultsWithOrderDescr(new ExchangeOrderResult(), toParse);
extendedOrder.IsBuy.Should().BeTrue();
extendedOrder.Amount.Should().Be(0.001254m);
extendedOrder.MarketSymbol.Should().Be("BTCUSDT");
extendedOrder.Price.Should().Be(1000);
}
}
}