From ddf8e7b0d201c0796c22cdba649396bb371f0314 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Thu, 1 Sep 2022 15:12:39 +0200 Subject: [PATCH] Use GetAdaptedSession consistently --- .../When_opening_storage_session_outside_pipeline.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/NServiceBus.AcceptanceTests/Core/Reliability/SynchronizedStorage/When_opening_storage_session_outside_pipeline.cs b/src/NServiceBus.AcceptanceTests/Core/Reliability/SynchronizedStorage/When_opening_storage_session_outside_pipeline.cs index 1650bc029c..f378c83af5 100644 --- a/src/NServiceBus.AcceptanceTests/Core/Reliability/SynchronizedStorage/When_opening_storage_session_outside_pipeline.cs +++ b/src/NServiceBus.AcceptanceTests/Core/Reliability/SynchronizedStorage/When_opening_storage_session_outside_pipeline.cs @@ -1,6 +1,5 @@ namespace NServiceBus.AcceptanceTests.Reliability.SynchronizedStorage { - using System.Reflection; using System.Threading.Tasks; using AcceptanceTesting; using EndpointTemplates; @@ -66,22 +65,18 @@ protected override async Task OnStart(IMessageSession session) using (var completableSynchronizedStorageSession = childBuilder.Build()) { - PropertyInfo propertyInfo = completableSynchronizedStorageSession.GetType() - .GetProperty("AdaptedSession"); - scenarioContext.AdaptedSessionIsNullBeforeOpening = - propertyInfo.GetValue(completableSynchronizedStorageSession) == null; + completableSynchronizedStorageSession.GetAdaptedSession() == null; await completableSynchronizedStorageSession.Open(new ContextBag()); scenarioContext.AdaptedSessionNotNullAfterOpening = - propertyInfo.GetValue(completableSynchronizedStorageSession) != null; + completableSynchronizedStorageSession.GetAdaptedSession() != null; var synchronizedStorage = childBuilder.Build(); scenarioContext.StorageSessionEqual = - propertyInfo - .GetValue(completableSynchronizedStorageSession) + completableSynchronizedStorageSession.GetAdaptedSession() .Equals(synchronizedStorage); await completableSynchronizedStorageSession.CompleteAsync();