File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
JSONAPI.TodoMVC.API.Tests Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,30 @@ public async Task Get()
3838 }
3939 }
4040
41+ [ TestMethod ]
42+ [ DeploymentItem ( @"Data\Todo.csv" , "Data" ) ]
43+ public async Task GetWithFilter ( )
44+ {
45+ using ( var effortConnection = TestHelpers . GetEffortConnection ( "Data" ) )
46+ {
47+ using ( var server = TestServer . Create ( app =>
48+ {
49+ var startup = new Startup ( context => new TodoMvcContext ( effortConnection , false ) ) ;
50+ startup . Configuration ( app ) ;
51+ } ) )
52+ {
53+ var response = await server . CreateRequest ( "http://localhost/todos?isCompleted=true" ) . GetAsync ( ) ;
54+ response . StatusCode . Should ( ) . Be ( HttpStatusCode . OK ) ;
55+ var responseContent = await response . Content . ReadAsStringAsync ( ) ;
56+
57+ var expected =
58+ JsonHelpers . MinifyJson (
59+ TestHelpers . ReadEmbeddedFile ( @"Acceptance\Fixtures\GetWithFilterResponse.json" ) ) ;
60+ responseContent . Should ( ) . Be ( expected ) ;
61+ }
62+ }
63+ }
64+
4165 [ TestMethod ]
4266 [ DeploymentItem ( @"Data\Todo.csv" , "Data" ) ]
4367 public async Task GetById ( )
Original file line number Diff line number Diff line change 1+ {
2+ "todos" : [
3+ {
4+ "id" : " 2" ,
5+ "text" : " Do the laundry" ,
6+ "isCompleted" : true
7+ }
8+ ]
9+ }
Original file line number Diff line number Diff line change 127127 <EmbeddedResource Include =" Acceptance\Fixtures\PostResponse.json" />
128128 <EmbeddedResource Include =" Acceptance\Fixtures\PutRequest.json" />
129129 <EmbeddedResource Include =" Acceptance\Fixtures\PutResponse.json" />
130+ <EmbeddedResource Include =" Acceptance\Fixtures\GetWithFilterResponse.json" />
130131 <None Include =" app.config" />
131132 <None Include =" Data\Todo.csv" >
132133 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
You can’t perform that action at this time.
0 commit comments