diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-12-26 20:22:14 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-12-26 20:22:14 -0800 |
commit | 391397a341282d0c088bc9e9901ced9b19a62e5a (patch) | |
tree | bc1cc264acba9edc486eefbbfbb5fd4822111fb1 /src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs | |
parent | 8f48e3f1daedb77e451f9fe8ac497741c6bb06f9 (diff) | |
parent | 3475fab579db0f6a1454ebc83d2e8a9c271e4c18 (diff) | |
download | DotNetOpenAuth-391397a341282d0c088bc9e9901ced9b19a62e5a.zip DotNetOpenAuth-391397a341282d0c088bc9e9901ced9b19a62e5a.tar.gz DotNetOpenAuth-391397a341282d0c088bc9e9901ced9b19a62e5a.tar.bz2 |
Merge branch 'retargeting-contracts'
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs index c43a3ad..6c6ad10 100644 --- a/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs +++ b/src/DotNetOpenAuth.OpenId/Configuration/OpenIdElement.cs @@ -8,14 +8,13 @@ namespace DotNetOpenAuth.Configuration { using System; using System.Collections.Generic; using System.Configuration; - using System.Diagnostics.Contracts; using DotNetOpenAuth.OpenId.ChannelElements; using DotNetOpenAuth.OpenId.Messages; + using Validation; /// <summary> /// Represents the <openid> element in the host's .config file. /// </summary> - [ContractVerification(true)] internal class OpenIdElement : ConfigurationSection { /// <summary> /// The name of the section under which this library's settings must be found. @@ -63,7 +62,6 @@ namespace DotNetOpenAuth.Configuration { /// </summary> public static OpenIdElement Configuration { get { - Contract.Ensures(Contract.Result<OpenIdElement>() != null); return (OpenIdElement)ConfigurationManager.GetSection(SectionName) ?? new OpenIdElement(); } } @@ -80,14 +78,13 @@ namespace DotNetOpenAuth.Configuration { [PositiveTimeSpanValidator] internal TimeSpan MaxAuthenticationTime { get { - Contract.Ensures(Contract.Result<TimeSpan>() > TimeSpan.Zero); TimeSpan result = (TimeSpan)this[MaxAuthenticationTimePropertyName]; - Contract.Assume(result > TimeSpan.Zero); // our PositiveTimeSpanValidator should take care of this + Assumes.True(result > TimeSpan.Zero); // our PositiveTimeSpanValidator should take care of this return result; } set { - Requires.InRange(value > TimeSpan.Zero, "value"); + Requires.Range(value > TimeSpan.Zero, "value"); this[MaxAuthenticationTimePropertyName] = value; } } |