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.RelyingParty/OpenId/RelyingParty/Associations.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.RelyingParty/OpenId/RelyingParty/Associations.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Associations.cs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Associations.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Associations.cs index f315bf0..44d7d07 100644 --- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Associations.cs +++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Associations.cs @@ -13,6 +13,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { using System.Diagnostics.Contracts; using System.Linq; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// A dictionary of handle/Association pairs. @@ -23,7 +24,6 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// can break if the collection is changed by another thread during enumeration. /// </remarks> [DebuggerDisplay("Count = {assocs.Count}")] - [ContractVerification(true)] internal class Associations { /// <summary> /// The lookup table where keys are the association handles and values are the associations themselves. @@ -47,8 +47,6 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// </remarks> public IEnumerable<Association> Best { get { - Contract.Ensures(Contract.Result<IEnumerable<Association>>() != null); - lock (this.associations) { return this.associations.OrderByDescending(assoc => assoc.Issued); } @@ -61,13 +59,12 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// <param name="association">The association to add to the collection.</param> public void Set(Association association) { Requires.NotNull(association, "association"); - Contract.Ensures(this.Get(association.Handle) == association); lock (this.associations) { this.associations.Remove(association.Handle); // just in case one already exists. this.associations.Add(association); } - Contract.Assume(this.Get(association.Handle) == association); + Assumes.True(this.Get(association.Handle) == association); } /// <summary> |