summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Messaging/Assumes.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2011-09-17 17:22:13 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2011-09-17 17:22:13 -0700
commitc8516e3a1f11e0945b46c712ab8cb89a9af096f8 (patch)
tree0a18ee01e0c56e74fc6a21809adf25da3948726f /src/DotNetOpenAuth.Messaging/Assumes.cs
parentbab1c76d35421a3d2a1608e6f3e66d67b4fbdb09 (diff)
downloadDotNetOpenAuth-c8516e3a1f11e0945b46c712ab8cb89a9af096f8.zip
DotNetOpenAuth-c8516e3a1f11e0945b46c712ab8cb89a9af096f8.tar.gz
DotNetOpenAuth-c8516e3a1f11e0945b46c712ab8cb89a9af096f8.tar.bz2
Added [Pure] attribute to validation methods.
Diffstat (limited to 'src/DotNetOpenAuth.Messaging/Assumes.cs')
-rw-r--r--src/DotNetOpenAuth.Messaging/Assumes.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Assumes.cs b/src/DotNetOpenAuth.Messaging/Assumes.cs
index 43de627..67205a2 100644
--- a/src/DotNetOpenAuth.Messaging/Assumes.cs
+++ b/src/DotNetOpenAuth.Messaging/Assumes.cs
@@ -8,6 +8,7 @@ namespace DotNetOpenAuth {
using System;
using System.Collections.Generic;
using System.Diagnostics;
+ using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
@@ -20,7 +21,7 @@ namespace DotNetOpenAuth {
/// </summary>
/// <param name="condition">The expression that must evaluate to true to avoid an internal error exception.</param>
/// <param name="message">The message to include with the exception.</param>
- [DebuggerStepThrough]
+ [Pure, DebuggerStepThrough]
internal static void True(bool condition, string message = null) {
if (!condition) {
Fail(message);
@@ -33,7 +34,7 @@ namespace DotNetOpenAuth {
/// <param name="condition">The expression that must evaluate to true to avoid an internal error exception.</param>
/// <param name="unformattedMessage">The unformatted message.</param>
/// <param name="args">Formatting arguments.</param>
- [DebuggerStepThrough]
+ [Pure, DebuggerStepThrough]
internal static void True(bool condition, string unformattedMessage, params object[] args) {
if (!condition) {
Fail(String.Format(unformattedMessage, args));
@@ -44,6 +45,7 @@ namespace DotNetOpenAuth {
/// Throws an internal error exception.
/// </summary>
/// <param name="message">The message.</param>
+ [Pure, DebuggerStepThrough]
internal static void Fail(string message = null) {
if (message != null) {
throw new InternalErrorException(message);