public void ExtendedProtectionPolicy_NoCustomServiceNames_ToString() { var channelBinding = new MockCustomChannelBinding(); var extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Always, channelBinding); string expectedResult = $"ProtectionScenario={extendedProtectionPolicy.ProtectionScenario}; PolicyEnforcement={PolicyEnforcement.Always}; CustomChannelBinding={channelBinding.ToString()}; ServiceNames=<null>"; string result = extendedProtectionPolicy.ToString(); Assert.Equal(expectedResult, result); }
public void ExtendedProtectionPolicy_Properties() { var customChannelBindingParam = new MockCustomChannelBinding(); var extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Always, customChannelBindingParam); Assert.Null(extendedProtectionPolicy.CustomServiceNames); Assert.Equal(PolicyEnforcement.Always, extendedProtectionPolicy.PolicyEnforcement); Assert.Equal(ProtectionScenario.TransportSelected, extendedProtectionPolicy.ProtectionScenario); Assert.Equal(customChannelBindingParam, extendedProtectionPolicy.CustomChannelBinding); }
public void Constructor_PolicyEnforcementChannelBinding_NeverParam() { var customChannelBinding = new MockCustomChannelBinding(); AssertExtensions.Throws <ArgumentException>("policyEnforcement", () => new ExtendedProtectionPolicy(PolicyEnforcement.Never, customChannelBinding)); }