Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegRa committed Jun 10, 2024
2 parents b06bde1 + 5e49497 commit e20e1e9
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 66 deletions.
10 changes: 5 additions & 5 deletions Alpaca.Markets.Tests.All/Alpaca.Markets.Tests.All.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Alpaca.Markets" Version="7.0.1" />
<PackageReference Include="Alpaca.Markets.Extensions" Version="7.0.0" />
<PackageReference Include="Alpaca.Markets" Version="7.1.0" />
<PackageReference Include="Alpaca.Markets.Extensions" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
12 changes: 6 additions & 6 deletions Alpaca.Markets.Tests.Win/Alpaca.Markets.Tests.Win.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Alpaca.Markets" Version="7.0.1" />
<PackageReference Include="Alpaca.Markets.Extensions" Version="7.0.0" />
<PackageReference Include="Alpaca.Markets" Version="7.1.0" />
<PackageReference Include="Alpaca.Markets.Extensions" Version="7.1.0" />
<PackageReference Include="IndexRange" Version="1.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Portable.System.DateTimeOnly" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Portable.System.DateTimeOnly" Version="8.0.1" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 2 additions & 0 deletions Alpaca.Markets.Tests.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a598a49f_002Dd414_002D4584_002D9be1_002D3ca43119126d/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private" Description="Methods (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="METHOD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=AAPL/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=AMZN/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BTCUSD/@EntryIndexedValue">True</s:Boolean>
Expand Down
4 changes: 2 additions & 2 deletions Alpaca.Markets.Tests/AlpacaCryptoDataClientTest.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Alpaca.Markets.Tests;
public sealed partial class AlpacaCryptoDataClientTest
{
[Fact]
public async void GetHistoricalBarsAsAsyncEnumerableWorks()
public async Task GetHistoricalBarsAsAsyncEnumerableWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -22,7 +22,7 @@ public async void GetHistoricalBarsAsAsyncEnumerableWorks()
}

[Fact]
public async void GetHistoricalQuotesAsAsyncEnumerableWorks()
public async Task GetHistoricalQuotesAsAsyncEnumerableWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-3).Date;
Expand Down
26 changes: 13 additions & 13 deletions Alpaca.Markets.Tests/AlpacaCryptoDataClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public AlpacaCryptoDataClientTest(
}

[Fact]
public async void ListDayHistoricalBarsWorks()
public async Task ListDayHistoricalBarsWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -25,7 +25,7 @@ public async void ListDayHistoricalBarsWorks()
}

[Fact]
public async void ListHourHistoricalBarsWorks()
public async Task ListHourHistoricalBarsWorks()
{
var into = await GetLastTradingDayCloseTimeUtc();
var from = into.AddHours(-5);
Expand All @@ -36,7 +36,7 @@ public async void ListHourHistoricalBarsWorks()
}

[Fact]
public async void ListMinuteHistoricalBarsWorks()
public async Task ListMinuteHistoricalBarsWorks()
{
var into = await GetLastTradingDayCloseTimeUtc();
var from = into.AddMinutes(-25);
Expand All @@ -47,7 +47,7 @@ public async void ListMinuteHistoricalBarsWorks()
}

[Fact]
public async void GetDayHistoricalBarsWorks()
public async Task GetDayHistoricalBarsWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -58,7 +58,7 @@ public async void GetDayHistoricalBarsWorks()
}

[Fact]
public async void ListHistoricalQuotesWorks()
public async Task ListHistoricalQuotesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-3).Date;
Expand All @@ -69,7 +69,7 @@ public async void ListHistoricalQuotesWorks()
}

[Fact]
public async void GetHistoricalQuotesWorks()
public async Task GetHistoricalQuotesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-3).Date;
Expand All @@ -80,7 +80,7 @@ public async void GetHistoricalQuotesWorks()
}

[Fact]
public async void ListHistoricalTradesWorks()
public async Task ListHistoricalTradesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-3).Date;
Expand All @@ -91,7 +91,7 @@ public async void ListHistoricalTradesWorks()
}

[Fact]
public async void GetHistoricalTradesWorks()
public async Task GetHistoricalTradesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-3).Date;
Expand All @@ -102,7 +102,7 @@ public async void GetHistoricalTradesWorks()
}

[Fact]
public async void ListLatestQuotesWorks()
public async Task ListLatestQuotesWorks()
{
foreach (var kvp in await Client
.ListLatestQuotesAsync(new LatestDataListRequest(Symbols)))
Expand All @@ -112,7 +112,7 @@ public async void ListLatestQuotesWorks()
}

[Fact]
public async void ListLatestTradesWorks()
public async Task ListLatestTradesWorks()
{
foreach (var kvp in await Client
.ListLatestTradesAsync(new LatestDataListRequest(Symbols)))
Expand All @@ -122,12 +122,12 @@ public async void ListLatestTradesWorks()
}

[Fact]
public async void LatestDataListRequestValidationWorks() =>
public async Task LatestDataListRequestValidationWorks() =>
await Assert.ThrowsAsync<RequestValidationException>(() => Client.ListLatestTradesAsync(
new LatestDataListRequest(new []{ String.Empty })));

[Fact]
public async void GetSnapshotWorks()
public async Task GetSnapshotWorks()
{
var snapshots = await Client.ListSnapshotsAsync(
new SnapshotDataListRequest(Symbols));
Expand All @@ -141,7 +141,7 @@ public async void GetSnapshotWorks()
}

[Fact]
public async void SnapshotDataListRequestValidationWorks() =>
public async Task SnapshotDataListRequestValidationWorks() =>
await Assert.ThrowsAsync<RequestValidationException>(() => Client
.ListSnapshotsAsync(new SnapshotDataListRequest(new []{ String.Empty })));

Expand Down
4 changes: 2 additions & 2 deletions Alpaca.Markets.Tests/AlpacaDataClientTest.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Alpaca.Markets.Tests;
public sealed partial class AlpacaDataClientTest
{
[Fact]
public async void GetHistoricalBarsAsAsyncEnumerableWorks()
public async Task GetHistoricalBarsAsAsyncEnumerableWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -21,7 +21,7 @@ public async void GetHistoricalBarsAsAsyncEnumerableWorks()
}

[Fact]
public async void GetHistoricalQuotesAsAsyncEnumerableWorks()
public async Task GetHistoricalQuotesAsAsyncEnumerableWorks()
{
var into = await GetLastTradingDayCloseTimeUtc();
var from = into.AddDays(-3).Date;
Expand Down
30 changes: 15 additions & 15 deletions Alpaca.Markets.Tests/AlpacaDataClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public AlpacaDataClientTest(
}

[Fact]
public async void ListDayHistoricalBarsWorks()
public async Task ListDayHistoricalBarsWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -25,7 +25,7 @@ public async void ListDayHistoricalBarsWorks()
}

[Fact]
public async void ListHourHistoricalBarsWorks()
public async Task ListHourHistoricalBarsWorks()
{
var into = await GetLastTradingDayCloseTimeUtc();
var from = into.AddHours(-5);
Expand All @@ -36,7 +36,7 @@ public async void ListHourHistoricalBarsWorks()
}

[Fact]
public async void ListMinuteHistoricalBarsWorks()
public async Task ListMinuteHistoricalBarsWorks()
{
var into = await GetLastTradingDayCloseTimeUtc();
var from = into.AddMinutes(-25);
Expand All @@ -47,7 +47,7 @@ public async void ListMinuteHistoricalBarsWorks()
}

[Fact]
public async void GetDayHistoricalBarsWorks()
public async Task GetDayHistoricalBarsWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -58,7 +58,7 @@ public async void GetDayHistoricalBarsWorks()
}

[Fact]
public async void ListHistoricalQuotesWorks()
public async Task ListHistoricalQuotesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -69,7 +69,7 @@ public async void ListHistoricalQuotesWorks()
}

[Fact]
public async void GetHistoricalQuotesWorks()
public async Task GetHistoricalQuotesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -80,7 +80,7 @@ public async void GetHistoricalQuotesWorks()
}

[Fact]
public async void ListHistoricalTradesWorks()
public async Task ListHistoricalTradesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -91,7 +91,7 @@ public async void ListHistoricalTradesWorks()
}

[Fact]
public async void GetHistoricalTradesWorks()
public async Task GetHistoricalTradesWorks()
{
var into = (await GetLastTradingDayCloseTimeUtc()).Date;
var from = into.AddDays(-5).Date;
Expand All @@ -102,15 +102,15 @@ public async void GetHistoricalTradesWorks()
}

[Fact]
public async void GetLatestQuoteWorks() =>
public async Task GetLatestQuoteWorks() =>
AssertQuoteIsValid(await Client.GetLatestQuoteAsync(new LatestMarketDataRequest(Symbol)));

[Fact]
public async void GetLatestTradeWorks() =>
public async Task GetLatestTradeWorks() =>
AssertTradeIsValid(await Client.GetLatestTradeAsync(new LatestMarketDataRequest(Symbol)));

[Fact]
public async void GetSnapshotWorks()
public async Task GetSnapshotWorks()
{
var snapshot = await Client.GetSnapshotAsync(new LatestMarketDataRequest(Symbol));

Expand All @@ -121,7 +121,7 @@ public async void GetSnapshotWorks()
}

[Fact]
public async void GetSnapshotsWorks()
public async Task GetSnapshotsWorks()
{
var snapshotsDictionary = await Client.ListSnapshotsAsync(new LatestMarketDataListRequest(Symbols));

Expand All @@ -135,15 +135,15 @@ public async void GetSnapshotsWorks()
}

[Fact]
public async void ListExchangesWorks() =>
public async Task ListExchangesWorks() =>
assertStringDictionaryIsValid(await Client.ListExchangesAsync());

[Fact]
public async void ListTradeConditionsWorks() =>
public async Task ListTradeConditionsWorks() =>
assertStringDictionaryIsValid(await Client.ListTradeConditionsAsync(Tape.A));

[Fact]
public async void ListQuoteConditionsWorks() =>
public async Task ListQuoteConditionsWorks() =>
assertStringDictionaryIsValid(await Client.ListQuoteConditionsAsync(Tape.C));

private void assertSnapshotIsValid(ISnapshot snapshot, String symbol)
Expand Down
2 changes: 1 addition & 1 deletion Alpaca.Markets.Tests/AlpacaStreamingClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public sealed class AlpacaStreamingClientTest(
PaperEnvironmentClientsFactoryFixture clientsFactory)
{
[Fact]
public async void ConnectWorks()
public async Task ConnectWorks()
{
using var client = clientsFactory.GetAlpacaStreamingClient();

Expand Down
2 changes: 1 addition & 1 deletion Alpaca.Markets.Tests/AlpacaTradingClientTest.Orders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public sealed partial class AlpacaTradingClientTest
{
[Fact(Skip = "Not always work correctly")]
public async void OrderPlaceCheckCancelWorks()
public async Task OrderPlaceCheckCancelWorks()
{
using var sockClient = clientsFactory.GetAlpacaStreamingClient();

Expand Down
12 changes: 6 additions & 6 deletions Alpaca.Markets.Tests/AlpacaTradingClientTest.WatchList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public sealed partial class AlpacaTradingClientTest
{
[Fact]
public async void AllOperationsByIdWork()
public async Task AllOperationsByIdWork()
{
var originalWatchListsList = await _alpacaTradingClient.ListWatchListsAsync();

Expand Down Expand Up @@ -58,7 +58,7 @@ public async void AllOperationsByIdWork()
}

[Fact]
public async void AllOperationsByNameWork()
public async Task AllOperationsByNameWork()
{
var originalWatchListsList = await _alpacaTradingClient.ListWatchListsAsync();

Expand Down Expand Up @@ -102,22 +102,22 @@ public async void AllOperationsByNameWork()
}

[Fact]
public async void UpdateWatchListRequestNameValidationWorks() =>
public async Task UpdateWatchListRequestNameValidationWorks() =>
await Assert.ThrowsAsync<RequestValidationException>(() => _alpacaTradingClient.UpdateWatchListByIdAsync(
new UpdateWatchListRequest(Guid.NewGuid(), String.Empty, Array.Empty<String>())));

[Fact]
public async void UpdateWatchListRequestSymbolsValidationWorks() =>
public async Task UpdateWatchListRequestSymbolsValidationWorks() =>
await Assert.ThrowsAsync<RequestValidationException>(() => _alpacaTradingClient.UpdateWatchListByIdAsync(
new UpdateWatchListRequest(Guid.NewGuid(), Guid.NewGuid().ToString("N"), new []{ String.Empty})));

[Fact]
public async void ChangeWatchListRequestNameValidationWorks() =>
public async Task ChangeWatchListRequestNameValidationWorks() =>
await Assert.ThrowsAsync<RequestValidationException>(() => _alpacaTradingClient.AddAssetIntoWatchListByNameAsync(
new ChangeWatchListRequest<String>(String.Empty, "AAPL")));

[Fact]
public async void ChangeWatchListRequestSymbolsValidationWorks() =>
public async Task ChangeWatchListRequestSymbolsValidationWorks() =>
await Assert.ThrowsAsync<RequestValidationException>(() => _alpacaTradingClient.AddAssetIntoWatchListByIdAsync(
new ChangeWatchListRequest<Guid>(Guid.NewGuid(), String.Empty)));
}
Loading

0 comments on commit e20e1e9

Please sign in to comment.