Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CleanArchitecture
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CleanArchitecture
Commits
46bd2d20
Commit
46bd2d20
authored
Oct 31, 2017
by
Steve Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
500bff60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
10 deletions
+3
-10
ToDoItemsController.cs
src/CleanArchitecture.Web/Api/ToDoItemsController.cs
+1
-0
ApiToDoItemsControllerListShould.cs
...Tests/Integration/Web/ApiToDoItemsControllerListShould.cs
+1
-7
BaseWebTest.cs
tests/CleanArchitecture.Tests/Integration/Web/BaseWebTest.cs
+1
-3
No files found.
src/CleanArchitecture.Web/Api/ToDoItemsController.cs
View file @
46bd2d20
...
...
@@ -50,6 +50,7 @@ namespace CleanArchitecture.Web.Api
public
IActionResult
MarkComplete
(
int
itemId
)
{
var
item
=
_todoRepository
.
GetById
(
itemId
);
if
(
item
==
null
)
return
NotFound
();
item
.
MarkComplete
();
_todoRepository
.
Update
(
item
);
...
...
tests/CleanArchitecture.Tests/Integration/Web/ApiToDoItemsControllerListShould.cs
View file @
46bd2d20
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.Web
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.TestHost
;
using
Newtonsoft.Json
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Net.Http
;
using
System.Net.Http.Headers
;
using
System.Threading.Tasks
;
using
Xunit
;
...
...
@@ -22,7 +16,7 @@ namespace CleanArchitecture.Tests.Integration.Web
var
response
=
await
_client
.
GetAsync
(
"/api/todoitems"
);
response
.
EnsureSuccessStatusCode
();
var
stringResponse
=
await
response
.
Content
.
ReadAsStringAsync
();
var
result
=
JsonConvert
.
DeserializeObject
<
IEnumerable
<
ToDoItem
>>(
stringResponse
)
.
ToList
()
;
var
result
=
JsonConvert
.
DeserializeObject
<
IEnumerable
<
ToDoItem
>>(
stringResponse
);
Assert
.
Equal
(
2
,
result
.
Count
());
Assert
.
Equal
(
1
,
result
.
Count
(
a
=>
a
.
Title
==
"Test Item 1"
));
...
...
tests/CleanArchitecture.Tests/Integration/Web/BaseWebTest.cs
View file @
46bd2d20
...
...
@@ -33,9 +33,7 @@ namespace CleanArchitecture.Tests.Integration.Web
.
UseEnvironment
(
"Testing"
);
// ensure ConfigureTesting is called in Startup
var
server
=
new
TestServer
(
builder
);
var
client
=
server
.
CreateClient
();
return
client
;
return
server
.
CreateClient
();
}
protected
virtual
void
InitializeServices
(
IServiceCollection
services
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment