@@ -17,22 +17,18 @@ public class TestInitFromJSON
1717 'responses': [
1818 {
1919 'match': {'regex': 'test'},
20- 'response': {
21- 'file': 'content.txt',
22- 'contenttype': 'text/plain',
23- 'delay': 10
24- }
20+ 'file': 'content.txt',
21+ 'contenttype': 'text/plain',
22+ 'delay': 10
2523 },
2624 {
2725 'match': {},
28- 'response': {
29- 'script': 'myscript.csscript',
30- 'contenttype': 'text/xml',
31- 'replacements': [
32- {'search': 'a', 'replace': 'b'},
33- {'search': 'foo', 'replace': 'bar'}
34- ]
35- }
26+ 'script': 'myscript.csscript',
27+ 'contenttype': 'text/xml',
28+ 'replacements': [
29+ {'search': 'a', 'replace': 'b'},
30+ {'search': 'foo', 'replace': 'bar'}
31+ ]
3632 }
3733 ]
3834}
@@ -86,7 +82,7 @@ public void Responses()
8682 [ Fact ]
8783 public void DeserializeXPathRequestMatcher ( )
8884 {
89- var response = ParseResponse ( "{'match': {'xpath': 'foo', 'namespaces': [{'prefix': 'foo', 'ns': 'urn:foo'}]}, 'response': {' file': 'foo.txt'} }" ) ;
85+ var response = ParseResponse ( "{'match': {'xpath': 'foo', 'namespaces': [{'prefix': 'foo', 'ns': 'urn:foo'}]}, 'file': 'foo.txt'}" ) ;
9086 var xpathMatcher = response . Item1 as XPathMatcher ;
9187 Assert . NotNull ( xpathMatcher ) ;
9288 Assert . Equal ( "foo" , xpathMatcher . XPathExpresssion ) ;
@@ -97,7 +93,7 @@ public void DeserializeXPathRequestMatcher()
9793 [ Fact ]
9894 public void DeserializeRegExRequestMatcher ( )
9995 {
100- var response = ParseResponse ( "{'match': {'regex': 'foobar'}, 'response': {' file': 'foo.txt'} }" ) ;
96+ var response = ParseResponse ( "{'match': {'regex': 'foobar'}, 'file': 'foo.txt'}" ) ;
10197 var regexMatcher = response . Item1 as RegexMatcher ;
10298 Assert . NotNull ( regexMatcher ) ;
10399 Assert . Equal ( "foobar" , regexMatcher . Expression ) ;
@@ -106,7 +102,7 @@ public void DeserializeRegExRequestMatcher()
106102 [ Fact ]
107103 public void DeserializeCompiledCreator ( )
108104 {
109- var response = ParseResponse ( "{'match': {'regex': 'foobar'}, 'response': {' assembly': 'foo.dll', 'class': 'Foo', 'method': 'Bar'} }" ) ;
105+ var response = ParseResponse ( "{'match': {'regex': 'foobar'}, 'assembly': 'foo.dll', 'class': 'Foo', 'method': 'Bar'}" ) ;
110106 var responseCreator = response . Item2 as AssemblyResponseCreator ;
111107 Assert . NotNull ( responseCreator ) ;
112108 Assert . Equal ( "r:\\ oot\\ directory\\ foo.dll" , responseCreator . AssemblyFilename ) ;
@@ -117,7 +113,7 @@ public void DeserializeCompiledCreator()
117113 [ Fact ]
118114 public void DeserializeForwardCreator ( )
119115 {
120- var response = ParseResponse ( "{'match': {}, 'response': {' forward': 'http://foo.bar'} }" ) ;
116+ var response = ParseResponse ( "{'match': {}, 'forward': 'http://foo.bar'}" ) ;
121117 var responseCreator = response . Item2 as ForwardResponseCreator ;
122118 Assert . NotNull ( responseCreator ) ;
123119 Assert . Equal ( "http://foo.bar" , responseCreator . Url ) ;
@@ -128,7 +124,7 @@ public void DeserializeForwardCreator()
128124 [ Fact ]
129125 public void DeserializeForwardCreatorWithProxyAndStripPath ( )
130126 {
131- var response = ParseResponse ( "{'match': {}, 'response': {' forward': 'http://foo.bar', 'proxy': 'http://localhost:1234', 'strippath': 'foo'} }" ) ;
127+ var response = ParseResponse ( "{'match': {}, 'forward': 'http://foo.bar', 'proxy': 'http://localhost:1234', 'strippath': 'foo'}" ) ;
132128 var responseCreator = response . Item2 as ForwardResponseCreator ;
133129 Assert . NotNull ( responseCreator ) ;
134130 Assert . Equal ( "http://foo.bar" , responseCreator . Url ) ;
@@ -139,7 +135,7 @@ public void DeserializeForwardCreatorWithProxyAndStripPath()
139135 [ Fact ]
140136 public void DeserializeLiteralResponse ( )
141137 {
142- var response = ParseResponse ( "{'match': {}, 'response': {' literal': 'Hello world', 'contenttype': 'text/plain'} }" ) ;
138+ var response = ParseResponse ( "{'match': {}, 'literal': 'Hello world', 'contenttype': 'text/plain'}" ) ;
143139 var responseCreator = response . Item2 as LiteralResponse ;
144140 Assert . NotNull ( responseCreator ) ;
145141 Assert . Equal ( "Hello world" , responseCreator . GetBody ( null ) ) ;
0 commit comments