Skip to content

Instantly share code, notes, and snippets.

@mikeobrien
Created May 25, 2011 18:58
Show Gist options
  • Save mikeobrien/991643 to your computer and use it in GitHub Desktop.
Save mikeobrien/991643 to your computer and use it in GitHub Desktop.
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