Example #1
0
        public void AffinitizeRequest_RequestIsAffinitized_DoNothing()
        {
            var dataProtector = GetDataProtector();
            var provider      = new ProviderStub(dataProtector.Object, AffinityTestHelper.GetLogger <BaseSessionAffinityProvider <string> >().Object);
            var context       = new DefaultHttpContext();

            provider.DirectlySetExtractedKeyOnContext(context, "ExtractedKey");
            provider.AffinitizeRequest(context, _defaultOptions, new DestinationInfo("id"));
            Assert.Null(provider.LastSetEncryptedKey);
            dataProtector.Verify(p => p.Protect(It.IsAny <byte[]>()), Times.Never);
        }