diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaCryptoStreamingClientTest.cs b/Alpaca.Markets.Extensions.Tests/AlpacaCryptoStreamingClientTest.cs index 9bd9e7cc..05b95c09 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaCryptoStreamingClientTest.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaCryptoStreamingClientTest.cs @@ -14,7 +14,7 @@ public sealed class AlpacaCryptoStreamingClientTest private const String Other = "ETHUSD"; - [Fact(Skip = "Temporary until Extensions package upgrade")] + [Fact] public async Task WithReconnectWorks() { var client = createMockClient( @@ -57,7 +57,6 @@ public async Task SubscribeOrderBookAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Bars.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Bars.cs index 213acf6c..7c5cdb19 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Bars.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Bars.cs @@ -31,7 +31,6 @@ public async Task SubscribeDailyBarAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } @@ -64,7 +63,6 @@ public async Task SubscribeMinuteBarAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } @@ -97,7 +95,6 @@ public async Task SubscribeUpdatedBarAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Cancellations.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Cancellations.cs index 68d598cd..9cad9cb5 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Cancellations.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Cancellations.cs @@ -31,7 +31,6 @@ public async Task SubscribeCancellationAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Corrections.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Corrections.cs index a32769eb..2139ff9c 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Corrections.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Corrections.cs @@ -31,7 +31,6 @@ public async Task SubscribeCorrectionAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Lulds.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Lulds.cs index 06dbe42a..92ff8732 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Lulds.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Lulds.cs @@ -31,7 +31,6 @@ public async Task SubscribeLimitUpLimitDownAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Quotes.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Quotes.cs index 75c02f8d..63be52fd 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Quotes.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Quotes.cs @@ -31,7 +31,6 @@ public async Task SubscribeQuoteAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Statuses.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Statuses.cs index ecdfa263..9c5d3e36 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Statuses.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Statuses.cs @@ -31,7 +31,6 @@ public async Task SubscribeStatusAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Trades.cs b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Trades.cs index ac72e231..434441e7 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Trades.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaDataStreamingClientTest.Trades.cs @@ -31,7 +31,6 @@ public async Task SubscribeTradeAsyncWorks() verifySubscriptions(subscriptionOne, subscriptionTwo); verifySubscriptionEvents(subscription, ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } } diff --git a/Alpaca.Markets.Extensions.Tests/AlpacaNewsStreamingClientTest.cs b/Alpaca.Markets.Extensions.Tests/AlpacaNewsStreamingClientTest.cs index 311c0a97..df81b689 100644 --- a/Alpaca.Markets.Extensions.Tests/AlpacaNewsStreamingClientTest.cs +++ b/Alpaca.Markets.Extensions.Tests/AlpacaNewsStreamingClientTest.cs @@ -142,7 +142,6 @@ public async Task SubscribeNewsAsyncWorks() _symbols.VerifySubscriptionsStreams(subscriptionOne, subscriptionTwo); subscription.VerifySubscriptionEventsNumber(ExpectedNumberOfEventsForOneSymbol); - await subscriptionOne.DisposeAsync(); client.VerifyAll(); } diff --git a/Alpaca.Markets.Tests/AlpacaTradingClientTest.Account.cs b/Alpaca.Markets.Tests/AlpacaTradingClientTest.Account.cs index e87d4b3e..9c85c365 100644 --- a/Alpaca.Markets.Tests/AlpacaTradingClientTest.Account.cs +++ b/Alpaca.Markets.Tests/AlpacaTradingClientTest.Account.cs @@ -181,7 +181,6 @@ public async Task GetPortfolioHistoryAsyncWorks() var history = await mock.Client.GetPortfolioHistoryAsync( new PortfolioHistoryRequest { - Period = new HistoryPeriod(5, HistoryPeriodUnit.Day), TimeFrame = TimeFrame.FifteenMinutes }.WithInterval(new Interval(today, today))); diff --git a/Alpaca.Markets/Enums/PositionIntent.cs b/Alpaca.Markets/Enums/PositionIntent.cs index 85a032d2..081e14e7 100644 --- a/Alpaca.Markets/Enums/PositionIntent.cs +++ b/Alpaca.Markets/Enums/PositionIntent.cs @@ -32,5 +32,5 @@ public enum PositionIntent /// [UsedImplicitly] [EnumMember(Value = "sell_to_close")] - SellToClose, + SellToClose } diff --git a/Alpaca.Markets/Helpers/Validation.cs b/Alpaca.Markets/Helpers/Validation.cs index 02461d19..a49f4957 100644 --- a/Alpaca.Markets/Helpers/Validation.cs +++ b/Alpaca.Markets/Helpers/Validation.cs @@ -55,28 +55,28 @@ public static TRequest Validate( public static RequestValidationException? TryValidateSymbolName( this String symbolName, - [CallerArgumentExpression("symbolName")] String propertyName = "") => + [CallerArgumentExpression(nameof(symbolName))] String propertyName = "") => String.IsNullOrWhiteSpace(symbolName) ? new RequestValidationException(SymbolShouldNotBeEmptyMessage, propertyName) : null; public static RequestValidationException? TryValidateSymbolName( this IEnumerable symbolNames, - [CallerArgumentExpression("symbolNames")] String propertyName = "") => + [CallerArgumentExpression(nameof(symbolNames))] String propertyName = "") => symbolNames.Any(String.IsNullOrWhiteSpace) ? new RequestValidationException(SymbolShouldNotBeEmptyMessage, propertyName) : null; public static RequestValidationException? TryValidateQuantity( this OrderQuantity quantity, - [CallerArgumentExpression("quantity")] String propertyName = "") => + [CallerArgumentExpression(nameof(quantity))] String propertyName = "") => quantity.Value <= 0M ? new RequestValidationException(OrderQuantityShouldBePositiveMessage, propertyName) : null; public static RequestValidationException? TryValidateQuantity( this Int64? quantity, - [CallerArgumentExpression("quantity")] String propertyName = "") => + [CallerArgumentExpression(nameof(quantity))] String propertyName = "") => quantity <= 0M ? new RequestValidationException(OrderQuantityShouldBePositiveMessage, propertyName) : null; @@ -84,42 +84,42 @@ public static TRequest Validate( public static RequestValidationException? TryValidatePageSize( this Pagination pagination, UInt32 maxPageSize, - [CallerArgumentExpression("pagination")] String propertyName = "") => + [CallerArgumentExpression(nameof(pagination))] String propertyName = "") => pagination.Size < Pagination.MinPageSize || pagination.Size > maxPageSize ? new RequestValidationException(RequestPageSizeTooBigOrTooSmallMessage, propertyName) : null; public static RequestValidationException? TryValidateSymbolsList( this IReadOnlyCollection symbolNames, - [CallerArgumentExpression("symbolNames")] String propertyName = "") => + [CallerArgumentExpression(nameof(symbolNames))] String propertyName = "") => symbolNames.Count == 0 ? new RequestValidationException(ListShouldContainsAtLeastOneItemMessage, propertyName) : null; public static RequestValidationException? TryValidateWatchListName( this String? watchListName, - [CallerArgumentExpression("watchListName")] String propertyName = "") => + [CallerArgumentExpression(nameof(watchListName))] String propertyName = "") => isWatchListNameInvalid(watchListName) ? new RequestValidationException(WatchListNameShouldBe64CharactersLengthMessage, propertyName) : null; public static RequestValidationException? TryValidateWatchListName( this TKey watchListName, - [CallerArgumentExpression("watchListName")] String propertyName = "") => + [CallerArgumentExpression(nameof(watchListName))] String propertyName = "") => watchListName is String stringKey && isWatchListNameInvalid(stringKey) ? new RequestValidationException(WatchListNameShouldBe64CharactersLengthMessage, propertyName) : null; public static RequestValidationException? TryValidateCollection( this IReadOnlyCollection collection, - [CallerArgumentExpression("collection")] String propertyName = "") => + [CallerArgumentExpression(nameof(collection))] String propertyName = "") => collection.Count == 0 ? new RequestValidationException(CollectionShouldNotBeEmptyMessage, propertyName) : null; public static RequestValidationException? TryValidateInterval( this Interval interval, - [CallerArgumentExpression("interval")] String propertyName = "") + [CallerArgumentExpression(nameof(interval))] String propertyName = "") where TItem : struct, IComparable => interval.IsOpen() ? new RequestValidationException(IntervalShouldNotBeOpenMessage, propertyName) @@ -127,7 +127,7 @@ public static TRequest Validate( public static String? ValidateWatchListName( this String? watchListName, - [CallerArgumentExpression("watchListName")] String propertyName = "") => + [CallerArgumentExpression(nameof(watchListName))] String propertyName = "") => isWatchListNameInvalid(watchListName) ? throw new ArgumentException(WatchListNameShouldBe64CharactersLengthMessage, propertyName) : watchListName;