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

Tests, typos and restructuring #28

Merged
merged 5 commits into from
May 5, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IInvestorsExchangeDataService
/// </summary>
/// <param name="symbols"></param>
/// <returns></returns>
Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepActionAsync(IEnumerable<string> symbols);
Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepAuctionAsync(IEnumerable<string> symbols);

/// <summary>
/// <see cref="https://iexcloud.io/docs/api/#deep-book"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,55 @@ namespace VSLee.IEXSharp.Service.Cloud.InvestorsExchangeData
{
internal class InvestorsExchangeDataService : IInvestorsExchangeDataService
{
private readonly ExecutorREST _executor;
private readonly ExecutorREST executor;

public InvestorsExchangeDataService(HttpClient client, string sk, string pk, bool sign)
{
_executor = new ExecutorREST(client, sk, pk, sign);
executor = new ExecutorREST(client, sk, pk, sign);
}

public async Task<IEXResponse<DeepResponse>> DeepAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<DeepResponse>("deep", symbols);
=> await executor.SymbolsExecuteAsync<DeepResponse>("deep", symbols);

public async Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepActionAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepAuctionResponse>>("deep/auction", symbols);
public async Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepAuctionAsync(IEnumerable<string> symbols)
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepAuctionResponse>>("deep/auction", symbols);

public async Task<IEXResponse<Dictionary<string, DeepBookResponse>>> DeepBookAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepBookResponse>>("deep/book", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepBookResponse>>("deep/book", symbols);

public async Task<IEXResponse<Dictionary<string, DeepOperationalHaltStatusResponse>>> DeepOperationHaltStatusAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepOperationalHaltStatusResponse>>("deep/op-halt-status", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepOperationalHaltStatusResponse>>("deep/op-halt-status", symbols);

public async Task<IEXResponse<Dictionary<string, DeepOfficialPriceResponse>>> DeepOfficialPriceAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepOfficialPriceResponse>>("deep/official-price", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepOfficialPriceResponse>>("deep/official-price", symbols);

public async Task<IEXResponse<Dictionary<string, DeepSecurityEventResponse>>> DeepSecurityEventAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepSecurityEventResponse>>("deep/security-event", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepSecurityEventResponse>>("deep/security-event", symbols);

public async Task<IEXResponse<Dictionary<string, DeepShortSalePriceTestStatusResponse>>> DeepShortSalePriceTestStatusAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepShortSalePriceTestStatusResponse>>("deep/ssr-status", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepShortSalePriceTestStatusResponse>>("deep/ssr-status", symbols);

public async Task<IEXResponse<DeepSystemEventResponse>> DeepSystemEventAsync()
=> await _executor.NoParamExecute<DeepSystemEventResponse>("deep/system-event");
=> await executor.NoParamExecute<DeepSystemEventResponse>("deep/system-event");

public async Task<IEXResponse<Dictionary<string, IEnumerable<DeepTradeResponse>>>> DeepTradeAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, IEnumerable<DeepTradeResponse>>>("deep/trades", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, IEnumerable<DeepTradeResponse>>>("deep/trades", symbols);

public async Task<IEXResponse<Dictionary<string, IEnumerable<DeepTradeResponse>>>> DeepTradeBreaksAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, IEnumerable<DeepTradeResponse>>>("deep/trades-breaks", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, IEnumerable<DeepTradeResponse>>>("deep/trades-breaks", symbols);

public async Task<IEXResponse<Dictionary<string, DeepTradingStatusResponse>>> DeepTradingStatusAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepTradingStatusResponse>>("deep/trades-status", symbols);
=> await executor.SymbolsExecuteAsync<Dictionary<string, DeepTradingStatusResponse>>("deep/trades-status", symbols);

public async Task<IEXResponse<IEnumerable<LastResponse>>> LastAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<IEnumerable<LastResponse>>("tops/last", symbols);
=> await executor.SymbolsExecuteAsync<IEnumerable<LastResponse>>("tops/last", symbols);

public async Task<IEXResponse<IEnumerable<ListedRegulationSHOThresholdSecuritiesListResponse>>> ListedRegulationSHOThresholdSecuritiesListAsync(string symbol)
=> await _executor.SymbolExecuteAsync<IEnumerable<ListedRegulationSHOThresholdSecuritiesListResponse>>(
=> await executor.SymbolExecuteAsync<IEnumerable<ListedRegulationSHOThresholdSecuritiesListResponse>>(
"stock/[symbol]/threshold-securities", symbol);

public async Task<IEXResponse<IEnumerable<ListedShortInterestListResponse>>> ListedShortInterestListAsync(string symbol)
=> await _executor.SymbolExecuteAsync<IEnumerable<ListedShortInterestListResponse>>(
=> await executor.SymbolExecuteAsync<IEnumerable<ListedShortInterestListResponse>>(
"stock/[symbol]/short-interest", symbol);

public async Task<IEXResponse<IEnumerable<StatsHisoricalDailyResponse>>> StatsHistoricalDailyByDateAsync(string date)
Expand All @@ -72,7 +72,7 @@ public async Task<IEXResponse<IEnumerable<StatsHisoricalDailyResponse>>> StatsHi

var pathNvc = new NameValueCollection();

return await _executor.ExecuteAsync<IEnumerable<StatsHisoricalDailyResponse>>(urlPattern, pathNvc, qsb);
return await executor.ExecuteAsync<IEnumerable<StatsHisoricalDailyResponse>>(urlPattern, pathNvc, qsb);
}

public async Task<IEXResponse<IEnumerable<StatsHisoricalDailyResponse>>> StatsHistoricalDailyByLastAsync(int last)
Expand All @@ -84,7 +84,7 @@ public async Task<IEXResponse<IEnumerable<StatsHisoricalDailyResponse>>> StatsHi

var pathNvc = new NameValueCollection();

return await _executor.ExecuteAsync<IEnumerable<StatsHisoricalDailyResponse>>(urlPattern, pathNvc, qsb);
return await executor.ExecuteAsync<IEnumerable<StatsHisoricalDailyResponse>>(urlPattern, pathNvc, qsb);
}

public async Task<IEXResponse<IEnumerable<StatsHistoricalSummaryResponse>>> StatsHistoricalSummaryAsync(DateTime? date = null)
Expand All @@ -96,25 +96,25 @@ public async Task<IEXResponse<IEnumerable<StatsHistoricalSummaryResponse>>> Stat

var pathNvc = new NameValueCollection();

return await _executor.ExecuteAsync<IEnumerable<StatsHistoricalSummaryResponse>>(urlPattern, pathNvc, qsb);
return await executor.ExecuteAsync<IEnumerable<StatsHistoricalSummaryResponse>>(urlPattern, pathNvc, qsb);
}

public async Task<IEXResponse<StatsIntradayResponse>> StatsIntradayAsync()
=> await _executor.NoParamExecute<StatsIntradayResponse>("stats/intraday");
=> await executor.NoParamExecute<StatsIntradayResponse>("stats/intraday");

public async Task<IEXResponse<IEnumerable<StatsRecentResponse>>> StatsRecentAsync()
=> await _executor.NoParamExecute<IEnumerable<StatsRecentResponse>>("stats/recent");
=> await executor.NoParamExecute<IEnumerable<StatsRecentResponse>>("stats/recent");

public async Task<IEXResponse<StatsRecordResponse>> StatsRecordAsync()
=> await _executor.NoParamExecute<StatsRecordResponse>("stats/records");
=> await executor.NoParamExecute<StatsRecordResponse>("stats/records");

public async Task<IEXResponse<IEnumerable<TOPSResponse>>> TOPSAsync(IEnumerable<string> symbols)
{
if (symbols.Count() > 0)
{
return await _executor.SymbolsExecuteAsync<IEnumerable<TOPSResponse>>("tops", symbols);
return await executor.SymbolsExecuteAsync<IEnumerable<TOPSResponse>>("tops", symbols);
}
return await _executor.NoParamExecute<IEnumerable<TOPSResponse>>("tops");
return await executor.NoParamExecute<IEnumerable<TOPSResponse>>("tops");
}
}
}
2 changes: 1 addition & 1 deletion IEXSharp/Service/Legacy/Market/IMarketService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public interface IMarketService
/// </summary>
/// <param name="symbols"></param>
/// <returns></returns>
Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepActionAsync(IEnumerable<string> symbols);
Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepAuctionAsync(IEnumerable<string> symbols);

/// <summary>
/// <see cref="https://iextrading.com/developer/docs/#official-price"/>
Expand Down
2 changes: 1 addition & 1 deletion IEXSharp/Service/Legacy/Market/MarketService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task<IEXResponse<Dictionary<string, DeepSecurityEventResponse>>> De
public async Task<IEXResponse<Dictionary<string, IEnumerable<DeepTradeResponse>>>> DeepTradeBreaksAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, IEnumerable<DeepTradeResponse>>>("deep/trades-breaks", symbols);

public async Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepActionAsync(IEnumerable<string> symbols)
public async Task<IEXResponse<Dictionary<string, DeepAuctionResponse>>> DeepAuctionAsync(IEnumerable<string> symbols)
=> await _executor.SymbolsExecuteAsync<Dictionary<string, DeepAuctionResponse>>("deep/auction", symbols);

public async Task<IEXResponse<Dictionary<string, DeepOfficialPriceResponse>>> DeepOfficialPriceAsync(IEnumerable<string> symbols)
Expand Down
7 changes: 2 additions & 5 deletions IEXSharpTest/Cloud/APISystemMetadataTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class APISystemMetadataTest
{
Expand Down
5 changes: 2 additions & 3 deletions IEXSharpTest/Cloud/AccountTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using NUnit.Framework;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.Account.Request;
using VSLee.IEXSharp.Model.Account.Response;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class AccountTest
{
Expand Down
4 changes: 2 additions & 2 deletions IEXSharpTest/Cloud/AlternativeDataTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using NUnit.Framework;
using System;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class AlternativeDataTest
{
Expand Down
4 changes: 2 additions & 2 deletions IEXSharpTest/Cloud/CorporateActionsTest.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IEXSharp.Model.CorporateActions.Request;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class CorporateActionsTest
{
Expand Down
4 changes: 2 additions & 2 deletions IEXSharpTest/Cloud/CryptoTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Linq;
using NUnit.Framework;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class CryptoTest
{
Expand Down
4 changes: 2 additions & 2 deletions IEXSharpTest/Cloud/ForexCurrenciesTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Linq;
using NUnit.Framework;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class ForexCurrenciesTest
{
Expand Down
11 changes: 5 additions & 6 deletions IEXSharpTest/Cloud/InvestorsExchangeDataTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using NUnit.Framework;
using System;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class InvestorsExchangeDataTest
{
Expand All @@ -28,11 +28,10 @@ public async Task DeepAsyncTest(params string[] symbols)
}

[Test]
[TestCase("AAPL")]
[TestCase("FB")]
public async Task DeepActionAsyncTest(params string[] symbols)
[TestCase("ziext")]
public async Task DeepAuctionAsyncTest(params string[] symbols)
{
var response = await sandBoxClient.InvestorsExchangeData.DeepActionAsync(symbols);
var response = await sandBoxClient.InvestorsExchangeData.DeepAuctionAsync(symbols);

Assert.IsNull(response.ErrorMessage);
Assert.IsNotNull(response.Data);
Expand Down
1 change: 0 additions & 1 deletion IEXSharpTest/Cloud/MarketInfoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using IEXSharp.Model.MarketInfo.Request;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.MarketInfo.Request;
using VSLee.IEXSharpTest.Cloud;

namespace IEXSharpTest.Cloud
{
Expand Down
6 changes: 3 additions & 3 deletions IEXSharpTest/Cloud/OptionsTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using VSLee.IEXSharp;
using NUnit.Framework;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.Options.Request;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class OptionsTest
{
Expand Down
4 changes: 2 additions & 2 deletions IEXSharpTest/Cloud/ReferenceDataTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using NUnit.Framework;
using System;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.ReferenceData.Request;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class ReferenceDataTest
{
Expand Down
8 changes: 4 additions & 4 deletions IEXSharpTest/Cloud/SSETest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.Stock.Request;
using NUnit.Framework;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.Stock.Request;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class SSETest
{
Expand Down
4 changes: 2 additions & 2 deletions IEXSharpTest/Cloud/StockFundamentalsTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using NUnit.Framework;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.StockFundamentals.Request;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class StockFundamentalsTest
{
Expand Down
6 changes: 3 additions & 3 deletions IEXSharpTest/Cloud/StockPricesTest.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using IEXSharp.Helper;
using NUnit.Framework;
using System;
using System.Linq;
using System.Threading.Tasks;
using IEXSharp.Helper;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Helper;
using VSLee.IEXSharp.Model.StockPrices.Request;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class StockPricesTest
{
Expand Down
7 changes: 2 additions & 5 deletions IEXSharpTest/Cloud/StockProfilesTest.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class StockProfilesTest
{
Expand Down
7 changes: 2 additions & 5 deletions IEXSharpTest/Cloud/StockResearchTest.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using VSLee.IEXSharp;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class StockResearchResearchTest
{
Expand Down
11 changes: 4 additions & 7 deletions IEXSharpTest/Cloud/StockTest.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.Stock.Request;
using NUnit.Framework;
using VSLee.IEXSharp.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IEXSharp.Helper;
using NUnit.Framework;
using VSLee.IEXSharp;
using VSLee.IEXSharp.Model.Stock.Request;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public class StockTest
{
Expand Down
6 changes: 1 addition & 5 deletions IEXSharpTest/Cloud/TestGlobal.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace VSLee.IEXSharpTest.Cloud
namespace IEXSharpTest.Cloud
{
public static class TestGlobal
{
Expand Down
Loading