Created
May 25, 2011 18:58
-
-
Save mikeobrien/991643 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session.asp | |
<% | |
Response.ContentType = "application/json" | |
If Request.QueryString("command") = "enumerate" Then | |
Response.Write("[") | |
Response.Write("{""Key"": ""key1"", ""Value"": ""value1"", ""DataType"": ""datatype1""},") | |
Response.Write("{""Key"": ""key2"", ""Value"": ""value2"", ""DataType"": ""datatype2""},") | |
Response.Write("{""Key"": ""key3"", ""Value"": ""value3"", ""DataType"": ""datatype3""}") | |
Response.Write("]") | |
End If | |
%> | |
RestSharp.cs | |
private readonly RestClient _client = new RestClient("http://localhost/RemoteSessionTestHarness"); | |
public class SessionVariable | |
{ | |
public string Key { get; set; } | |
public string Value { get; set; } | |
public string DataType { get; set; } | |
} | |
[Test] | |
public void Should_Enumerate_Session_Variables() | |
{ | |
var result = _client.Execute<List<SessionVariable>>(new RestRequest("session.asp?command=enumerate")); | |
result.Data.Count.ShouldEqual(3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment