summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/Mocks/TestMessage.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-11-20 06:54:14 -0800
committerAndrew <andrewarnott@gmail.com>2008-11-20 06:54:14 -0800
commit1a882368e2e99e9360cfd1f4f23f5acb70306436 (patch)
treeab0d370a8b8b9d5b638524f189a39991970834bb /src/DotNetOpenAuth.Test/Mocks/TestMessage.cs
parentd51be63270463542a308a9a2cef992b7d55baaa6 (diff)
downloadDotNetOpenAuth-1a882368e2e99e9360cfd1f4f23f5acb70306436.zip
DotNetOpenAuth-1a882368e2e99e9360cfd1f4f23f5acb70306436.tar.gz
DotNetOpenAuth-1a882368e2e99e9360cfd1f4f23f5acb70306436.tar.bz2
Reworked the way messages are instantiated and deserialized.
This was a whole lot of work to just get multi-version capability added to message types so that OpenID could handle its few versions.
Diffstat (limited to 'src/DotNetOpenAuth.Test/Mocks/TestMessage.cs')
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/TestMessage.cs27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/TestMessage.cs b/src/DotNetOpenAuth.Test/Mocks/TestMessage.cs
index 55e44ba..4a168a1 100644
--- a/src/DotNetOpenAuth.Test/Mocks/TestMessage.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/TestMessage.cs
@@ -11,15 +11,16 @@ namespace DotNetOpenAuth.Test.Mocks {
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
- internal class TestMessage : IProtocolMessage {
+ internal abstract class TestMessage : IDirectResponseProtocolMessage {
private MessageTransport transport;
private Dictionary<string, string> extraData = new Dictionary<string, string>();
+ private bool incoming;
- internal TestMessage()
+ protected TestMessage()
: this(MessageTransport.Direct) {
}
- internal TestMessage(MessageTransport transport) {
+ protected TestMessage(MessageTransport transport) {
this.transport = transport;
}
@@ -34,7 +35,7 @@ namespace DotNetOpenAuth.Test.Mocks {
[MessagePart(IsRequired = true)]
public DateTime Timestamp { get; set; }
- #region IProtocolMessage Members
+ #region IProtocolMessage Properties
Version IProtocolMessage.ProtocolVersion {
get { return new Version(1, 0); }
@@ -52,7 +53,19 @@ namespace DotNetOpenAuth.Test.Mocks {
get { return this.extraData; }
}
- bool IProtocolMessage.Incoming { get; set; }
+ bool IProtocolMessage.Incoming {
+ get { return this.incoming; }
+ }
+
+ #endregion
+
+ #region IDirectResponseProtocolMessage Members
+
+ public IDirectedProtocolMessage OriginatingRequest { get; set; }
+
+ #endregion
+
+ #region IProtocolMessage Methods
void IProtocolMessage.EnsureValidMessage() {
if (this.EmptyMember != null || this.Age < 0) {
@@ -61,5 +74,9 @@ namespace DotNetOpenAuth.Test.Mocks {
}
#endregion
+
+ internal void SetAsIncoming() {
+ this.incoming = true;
+ }
}
}