From 4fb0b63b1a34742139d20ed8355b0d1a76d8ab8e Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 8 Oct 2020 21:34:39 +0200 Subject: [PATCH 1/4] Split factory interface in two This removes dead code with interface implementations which weren't neccessary or threw NotImplemented/NotSupported exceptions --- .../Objects/Core/IArrayStringFactory.cs | 7 +++++++ ...ringFactory.cs => IObjectStringFactory.cs} | 4 +--- .../Factories/AggregatedOutputFactory.cs | 4 ++-- .../Factories/BatchStatusPostResultFactory.cs | 2 +- .../Objects/Factories/DayStatisticsFactory.cs | 7 +++---- .../Objects/Factories/ExtendedFactory.cs | 2 +- .../Objects/Factories/FavouriteFactory.cs | 2 +- .../Objects/Factories/InsolationFactory.cs | 2 +- .../Objects/Factories/MissingFactory.cs | 6 ++---- .../Objects/Factories/OutputFactory.cs | 4 ++-- .../Objects/Factories/StatisticFactory.cs | 6 ++---- .../Objects/Factories/StatusFactory.cs | 4 +--- .../Objects/Factories/StatusHistoryFactory.cs | 2 +- .../Factories/StringFactoryContainer.cs | 20 +++++++++++-------- .../Objects/Factories/SupplyFactory.cs | 2 +- .../Objects/Factories/SystemFactory.cs | 6 ++---- .../Factories/SystemSearchResultFactory.cs | 2 +- .../Objects/Factories/TeamFactory.cs | 4 +--- .../Objects/Factories/TeamOutputFactory.cs | 4 ++-- 19 files changed, 44 insertions(+), 46 deletions(-) create mode 100644 src/PVOutput.Net/Objects/Core/IArrayStringFactory.cs rename src/PVOutput.Net/Objects/Core/{IStringFactory.cs => IObjectStringFactory.cs} (57%) diff --git a/src/PVOutput.Net/Objects/Core/IArrayStringFactory.cs b/src/PVOutput.Net/Objects/Core/IArrayStringFactory.cs new file mode 100644 index 0000000..357ef7e --- /dev/null +++ b/src/PVOutput.Net/Objects/Core/IArrayStringFactory.cs @@ -0,0 +1,7 @@ +namespace PVOutput.Net.Objects.Core +{ + internal interface IArrayStringFactory : IObjectStringFactory + { + IArrayStringReader CreateArrayReader(); + } +} diff --git a/src/PVOutput.Net/Objects/Core/IStringFactory.cs b/src/PVOutput.Net/Objects/Core/IObjectStringFactory.cs similarity index 57% rename from src/PVOutput.Net/Objects/Core/IStringFactory.cs rename to src/PVOutput.Net/Objects/Core/IObjectStringFactory.cs index f0719e1..8671c86 100644 --- a/src/PVOutput.Net/Objects/Core/IStringFactory.cs +++ b/src/PVOutput.Net/Objects/Core/IObjectStringFactory.cs @@ -2,10 +2,8 @@ namespace PVOutput.Net.Objects.Core { - internal interface IStringFactory + internal interface IObjectStringFactory { IObjectStringReader CreateObjectReader(); - - IArrayStringReader CreateArrayReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/AggregatedOutputFactory.cs b/src/PVOutput.Net/Objects/Factories/AggregatedOutputFactory.cs index 9f3267c..29e6949 100644 --- a/src/PVOutput.Net/Objects/Factories/AggregatedOutputFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/AggregatedOutputFactory.cs @@ -1,10 +1,10 @@ -using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class AggregatedOutputFactory : IStringFactory + internal class AggregatedOutputFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/BatchStatusPostResultFactory.cs b/src/PVOutput.Net/Objects/Factories/BatchStatusPostResultFactory.cs index 29dbb7f..353ce41 100644 --- a/src/PVOutput.Net/Objects/Factories/BatchStatusPostResultFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/BatchStatusPostResultFactory.cs @@ -4,7 +4,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class BatchStatusPostResultFactory : IStringFactory + internal class BatchStatusPostResultFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/DayStatisticsFactory.cs b/src/PVOutput.Net/Objects/Factories/DayStatisticsFactory.cs index 8a693b4..b3ac28a 100644 --- a/src/PVOutput.Net/Objects/Factories/DayStatisticsFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/DayStatisticsFactory.cs @@ -1,12 +1,11 @@ -using PVOutput.Net.Objects.Core; +using System; +using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class DayStatisticsFactory : IStringFactory + internal class DayStatisticsFactory : IObjectStringFactory { - public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); - public IObjectStringReader CreateObjectReader() => new DayStatisticsObjectStringReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/ExtendedFactory.cs b/src/PVOutput.Net/Objects/Factories/ExtendedFactory.cs index 5eb1944..07b65b8 100644 --- a/src/PVOutput.Net/Objects/Factories/ExtendedFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/ExtendedFactory.cs @@ -5,7 +5,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class ExtendedFactory : IStringFactory + internal class ExtendedFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/FavouriteFactory.cs b/src/PVOutput.Net/Objects/Factories/FavouriteFactory.cs index fa22713..1c20a2a 100644 --- a/src/PVOutput.Net/Objects/Factories/FavouriteFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/FavouriteFactory.cs @@ -5,7 +5,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class FavouriteFactory : IStringFactory + internal class FavouriteFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader('\n'); diff --git a/src/PVOutput.Net/Objects/Factories/InsolationFactory.cs b/src/PVOutput.Net/Objects/Factories/InsolationFactory.cs index 082db5a..79a76dc 100644 --- a/src/PVOutput.Net/Objects/Factories/InsolationFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/InsolationFactory.cs @@ -5,7 +5,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class InsolationFactory : IStringFactory + internal class InsolationFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/MissingFactory.cs b/src/PVOutput.Net/Objects/Factories/MissingFactory.cs index db69016..83fe4ec 100644 --- a/src/PVOutput.Net/Objects/Factories/MissingFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/MissingFactory.cs @@ -1,14 +1,12 @@ -using System; +using System; using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class MissingFactory : IStringFactory + internal class MissingFactory : IObjectStringFactory { - public IArrayStringReader CreateArrayReader() => throw new NotImplementedException(); - public IObjectStringReader CreateObjectReader() => new MissingObjectStringReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/OutputFactory.cs b/src/PVOutput.Net/Objects/Factories/OutputFactory.cs index d47b406..71ae2d0 100644 --- a/src/PVOutput.Net/Objects/Factories/OutputFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/OutputFactory.cs @@ -1,10 +1,10 @@ -using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class OutputFactory : IStringFactory + internal class OutputFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/StatisticFactory.cs b/src/PVOutput.Net/Objects/Factories/StatisticFactory.cs index ef66859..b1ffd7e 100644 --- a/src/PVOutput.Net/Objects/Factories/StatisticFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/StatisticFactory.cs @@ -1,13 +1,11 @@ -using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class StatisticFactory : IStringFactory + internal class StatisticFactory : IObjectStringFactory { - public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); - public IObjectStringReader CreateObjectReader() => new StatisticObjectStringReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/StatusFactory.cs b/src/PVOutput.Net/Objects/Factories/StatusFactory.cs index 3cf72ed..8f707db 100644 --- a/src/PVOutput.Net/Objects/Factories/StatusFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/StatusFactory.cs @@ -4,10 +4,8 @@ namespace PVOutput.Net.Objects.Factories { - internal class StatusFactory : IStringFactory + internal class StatusFactory : IObjectStringFactory { - public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); - public IObjectStringReader CreateObjectReader() => new StatusObjectStringReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/StatusHistoryFactory.cs b/src/PVOutput.Net/Objects/Factories/StatusHistoryFactory.cs index d596dee..f8ab585 100644 --- a/src/PVOutput.Net/Objects/Factories/StatusHistoryFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/StatusHistoryFactory.cs @@ -4,7 +4,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class StatusHistoryFactory : IStringFactory + internal class StatusHistoryFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/StringFactoryContainer.cs b/src/PVOutput.Net/Objects/Factories/StringFactoryContainer.cs index b86b79b..bd2b64a 100644 --- a/src/PVOutput.Net/Objects/Factories/StringFactoryContainer.cs +++ b/src/PVOutput.Net/Objects/Factories/StringFactoryContainer.cs @@ -29,28 +29,32 @@ static StringFactoryContainer() _readerFactories.Add(typeof(ISystemSearchResult), new SystemSearchResultFactory()); } - public static IStringFactory GetStringFactory() + private static object GetObjectStringFactory() { - var type = typeof(TReturnType); - + Type type = typeof(TReturnType); if (!_readerFactories.ContainsKey(type)) { - throw new NotSupportedException($"Factory for {type} is not known"); + throw new InvalidOperationException($"Factory for {type} is not known"); } - return (IStringFactory)_readerFactories[type]; + return _readerFactories[type]; } public static IObjectStringReader CreateObjectReader() { - var factory = GetStringFactory(); + // Currently every factory is an ObjectStringFactory at minimum + var factory = GetObjectStringFactory() as IObjectStringFactory; return factory.CreateObjectReader(); } public static IArrayStringReader CreateArrayReader() { - var factory = GetStringFactory(); - return factory.CreateArrayReader(); + var factory = GetObjectStringFactory(); + if (factory is IArrayStringFactory arrayFactory) + { + return arrayFactory.CreateArrayReader(); + } + throw new InvalidOperationException($"Factory for {typeof(TReturnType)} is not an array factory"); } } } diff --git a/src/PVOutput.Net/Objects/Factories/SupplyFactory.cs b/src/PVOutput.Net/Objects/Factories/SupplyFactory.cs index f2d53ec..bfb5aea 100644 --- a/src/PVOutput.Net/Objects/Factories/SupplyFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/SupplyFactory.cs @@ -4,7 +4,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class SupplyFactory : IStringFactory + internal class SupplyFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/SystemFactory.cs b/src/PVOutput.Net/Objects/Factories/SystemFactory.cs index fbce73e..168a5cc 100644 --- a/src/PVOutput.Net/Objects/Factories/SystemFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/SystemFactory.cs @@ -1,13 +1,11 @@ -using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class SystemFactory : IStringFactory + internal class SystemFactory : IObjectStringFactory { - public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); - public IObjectStringReader CreateObjectReader() => new SystemObjectStringReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/SystemSearchResultFactory.cs b/src/PVOutput.Net/Objects/Factories/SystemSearchResultFactory.cs index 8934129..601bdd6 100644 --- a/src/PVOutput.Net/Objects/Factories/SystemSearchResultFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/SystemSearchResultFactory.cs @@ -5,7 +5,7 @@ namespace PVOutput.Net.Objects.Factories { - internal class SystemSearchResultFactory : IStringFactory + internal class SystemSearchResultFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new LineDelimitedArrayStringReader(); diff --git a/src/PVOutput.Net/Objects/Factories/TeamFactory.cs b/src/PVOutput.Net/Objects/Factories/TeamFactory.cs index f1ed09f..a6063ac 100644 --- a/src/PVOutput.Net/Objects/Factories/TeamFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/TeamFactory.cs @@ -5,10 +5,8 @@ namespace PVOutput.Net.Objects.Factories { - internal class TeamFactory : IStringFactory + internal class TeamFactory : IObjectStringFactory { - public IArrayStringReader CreateArrayReader() => throw new NotImplementedException(); - public IObjectStringReader CreateObjectReader() => new TeamObjectStringReader(); } } diff --git a/src/PVOutput.Net/Objects/Factories/TeamOutputFactory.cs b/src/PVOutput.Net/Objects/Factories/TeamOutputFactory.cs index 0285965..7f0eadb 100644 --- a/src/PVOutput.Net/Objects/Factories/TeamOutputFactory.cs +++ b/src/PVOutput.Net/Objects/Factories/TeamOutputFactory.cs @@ -1,10 +1,10 @@ -using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Core; using PVOutput.Net.Objects.Modules; using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Objects.Factories { - internal class TeamOutputFactory : IStringFactory + internal class TeamOutputFactory : IArrayStringFactory { public IArrayStringReader CreateArrayReader() => new CharacterDelimitedArrayStringReader(); From 06e26698df9b85ab7d74c37be1ff7cd49fd13e25 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 8 Oct 2020 21:51:41 +0200 Subject: [PATCH 2/4] Improved coverage for StringFactoryContainer --- .../Handler/OtherObjectTests.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs b/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs index acac2f2..d5bfa53 100644 --- a/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs +++ b/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs @@ -5,6 +5,9 @@ using Microsoft.VisualStudio.TestPlatform.Common.Interfaces; using NUnit.Framework; using PVOutput.Net.Objects; +using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Factories; +using PVOutput.Net.Objects.Modules.Readers; namespace PVOutput.Net.Tests.Handler { @@ -89,6 +92,7 @@ public bool ExtendedDataConfiguration_OperatorEquals_ReturnsValueEquality(Extend { return configuration1 == configuration2; } + public static IEnumerable ExtendedDataConfigurationInvertedEqualityTestCases { get @@ -105,5 +109,35 @@ public bool ExtendedDataConfiguration_OperatorNotEquals_ReturnsValueEquality(Ext { return configuration1 != configuration2; } + + [Test] + public void StringFactoryContainer_ForType_CreatesObjectReader() + { + IObjectStringReader reader = StringFactoryContainer.CreateObjectReader(); + Assert.That(reader, Is.TypeOf()); + } + + [Test] + public void StringFactoryContainer_ForType_CreatesArrayReader() + { + IArrayStringReader reader = StringFactoryContainer.CreateArrayReader(); + Assert.That(reader, Is.TypeOf>()); + } + + [Test] + public void StringFactoryContainer_ForUnknownType_Throws() + { + Assert.Throws(() => { + _ = StringFactoryContainer.CreateObjectReader(); + }); + } + + [Test] + public void StringFactoryContainer_ForTypeWithoutArrayReader_Throws() + { + Assert.Throws(() => { + _ = StringFactoryContainer.CreateArrayReader(); + }); + } } } From d347e535e934b731d3daea0cad57eb894f336866 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 8 Oct 2020 22:08:31 +0200 Subject: [PATCH 3/4] Coverage over 99% ! --- .../Handler/BaseRequestHandlingTests.cs | 38 +++++++++++++++++++ .../Handler/OtherObjectTests.cs | 18 ++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/tests/PVOutput.Net.Tests/Handler/BaseRequestHandlingTests.cs b/tests/PVOutput.Net.Tests/Handler/BaseRequestHandlingTests.cs index dbeb308..4cbeb8a 100644 --- a/tests/PVOutput.Net.Tests/Handler/BaseRequestHandlingTests.cs +++ b/tests/PVOutput.Net.Tests/Handler/BaseRequestHandlingTests.cs @@ -6,6 +6,8 @@ using NUnit.Framework; using PVOutput.Net.Enums; using PVOutput.Net.Objects; +using PVOutput.Net.Objects.Core; +using PVOutput.Net.Objects.Factories; using PVOutput.Net.Objects.Modules.Implementations; using PVOutput.Net.Responses; using PVOutput.Net.Tests.Utils; @@ -225,5 +227,41 @@ public void BaseResponse_ImplicitBoolConversion_ReturnsSuccessState() Assert.That((bool)response3, Is.False); }); } + + [Test] + public async Task BaseObjectReader_WithNullStream_ReturnsDefaultForType() + { + IObjectStringReader reader = StringFactoryContainer.CreateObjectReader(); + IStatus content = await reader.ReadObjectAsync(stream: null, cancellationToken: default).ConfigureAwait(false); + + Assert.That(content, Is.Null); + } + + [Test] + public async Task BaseArrayReader_WithNullStream_ReturnsDefaultForType() + { + IArrayStringReader reader = StringFactoryContainer.CreateArrayReader(); + IEnumerable content = await reader.ReadArrayAsync(stream: null, cancellationToken: default).ConfigureAwait(false); + + Assert.That(content, Is.Null); + } + + [Test] + public async Task CharacterDelimitedArrayReader_WithNullStream_ReturnsDefaultForType() + { + IArrayStringReader reader = new CharacterDelimitedArrayStringReader(); + IEnumerable content = await reader.ReadArrayAsync(stream: null, cancellationToken: default).ConfigureAwait(false); + + Assert.That(content, Is.Null); + } + + [Test] + public async Task LineDelimitedArrayReader_WithNullStream_ReturnsDefaultForType() + { + IArrayStringReader reader = new LineDelimitedArrayStringReader(); + IEnumerable content = await reader.ReadArrayAsync(stream: null, cancellationToken: default).ConfigureAwait(false); + + Assert.That(content, Is.Null); + } } } diff --git a/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs b/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs index d5bfa53..42ede4d 100644 --- a/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs +++ b/tests/PVOutput.Net.Tests/Handler/OtherObjectTests.cs @@ -26,7 +26,14 @@ public static IEnumerable PVCoordinateRegularEqualityTestCases [Test] [TestCaseSource(typeof(OtherObjectTests), nameof(PVCoordinateRegularEqualityTestCases))] - public bool PVCoordinate_Equals_ReturnsValueEquality(PVCoordinate coordinate1, PVCoordinate coordinate2) + public bool PVCoordinate_EqualsByType_ReturnsValueEquality(PVCoordinate coordinate1, PVCoordinate coordinate2) + { + return coordinate1.Equals(coordinate2); + } + + [Test] + [TestCaseSource(typeof(OtherObjectTests), nameof(PVCoordinateRegularEqualityTestCases))] + public bool PVCoordinate_EqualsByObject_ReturnsValueEquality(PVCoordinate coordinate1, object coordinate2) { return coordinate1.Equals(coordinate2); } @@ -74,7 +81,14 @@ public static IEnumerable ExtendedDataConfigurationRegularEqualityTestCases [Test] [TestCaseSource(typeof(OtherObjectTests), nameof(ExtendedDataConfigurationRegularEqualityTestCases))] - public bool ExtendedDataConfiguration_Equals_ReturnsValueEquality(ExtendedDataConfiguration configuration1, ExtendedDataConfiguration configuration2) + public bool ExtendedDataConfiguration_EqualsByType_ReturnsValueEquality(ExtendedDataConfiguration configuration1, ExtendedDataConfiguration configuration2) + { + return configuration1.Equals(configuration2); + } + + [Test] + [TestCaseSource(typeof(OtherObjectTests), nameof(ExtendedDataConfigurationRegularEqualityTestCases))] + public bool ExtendedDataConfiguration_EqualsByObject_ReturnsValueEquality(ExtendedDataConfiguration configuration1, object configuration2) { return configuration1.Equals(configuration2); } From b492ccfafb908c1a26cc7676af652c76ab89bd99 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 8 Oct 2020 22:26:15 +0200 Subject: [PATCH 4/4] HttpResponseMessage cannot be null As per CoreFX it's impossible for HttpResponseMessage to be null. If it almost would be, the HttpClient itself would throw. This solves a last couple of partial code coverage hits. https://github.com/dotnet/runtime/issues/19925#issuecomment-272664671 --- src/PVOutput.Net/Requests/Handler/RequestHandler.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVOutput.Net/Requests/Handler/RequestHandler.cs b/src/PVOutput.Net/Requests/Handler/RequestHandler.cs index 8882349..709de9f 100644 --- a/src/PVOutput.Net/Requests/Handler/RequestHandler.cs +++ b/src/PVOutput.Net/Requests/Handler/RequestHandler.cs @@ -60,7 +60,7 @@ internal async Task> ExecuteSingleItemReq } finally { - responseMessage?.Dispose(); + responseMessage.Dispose(); } } @@ -96,7 +96,7 @@ internal async Task> ExecuteArrayReq } finally { - responseMessage?.Dispose(); + responseMessage.Dispose(); } } @@ -129,7 +129,7 @@ internal async Task ExecutePostRequestAsync(IRequest requ } finally { - responseMessage?.Dispose(); + responseMessage.Dispose(); } }