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
8c42acc4
Commit
8c42acc4
authored
Jul 23, 2019
by
Steve Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating ToDoItem
parent
fd6102e1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
ToDoItem.cs
src/CleanArchitecture.Core/Entities/ToDoItem.cs
+1
-1
ToDoItemMarkComplete.cs
...nArchitecture.Tests/Core/Entities/ToDoItemMarkComplete.cs
+6
-2
ToDoItemBuilder.cs
tests/CleanArchitecture.Tests/ToDoItemBuilder.cs
+8
-1
No files found.
src/CleanArchitecture.Core/Entities/ToDoItem.cs
View file @
8c42acc4
...
@@ -5,7 +5,7 @@ namespace CleanArchitecture.Core.Entities
...
@@ -5,7 +5,7 @@ namespace CleanArchitecture.Core.Entities
{
{
public
class
ToDoItem
:
BaseEntity
public
class
ToDoItem
:
BaseEntity
{
{
public
string
Title
{
get
;
set
;
}
public
string
Title
{
get
;
set
;
}
=
string
.
Empty
;
public
string
Description
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
bool
IsDone
{
get
;
private
set
;
}
public
bool
IsDone
{
get
;
private
set
;
}
...
...
tests/CleanArchitecture.Tests/Core/Entities/ToDoItemMarkComplete.cs
View file @
8c42acc4
using
CleanArchitecture.Core.Events
;
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.Core.Events
;
using
System.Linq
;
using
System.Linq
;
using
Xunit
;
using
Xunit
;
...
@@ -9,7 +10,10 @@ namespace CleanArchitecture.Tests.Core.Entities
...
@@ -9,7 +10,10 @@ namespace CleanArchitecture.Tests.Core.Entities
[
Fact
]
[
Fact
]
public
void
SetsIsDoneToTrue
()
public
void
SetsIsDoneToTrue
()
{
{
var
item
=
new
ToDoItemBuilder
().
Build
();
var
item
=
new
ToDoItemBuilder
()
.
WithDefaultValues
()
.
Description
(
""
)
.
Build
();
item
.
MarkComplete
();
item
.
MarkComplete
();
...
...
tests/CleanArchitecture.Tests/ToDoItemBuilder.cs
View file @
8c42acc4
...
@@ -4,7 +4,7 @@ namespace CleanArchitecture.Tests
...
@@ -4,7 +4,7 @@ namespace CleanArchitecture.Tests
{
{
public
class
ToDoItemBuilder
public
class
ToDoItemBuilder
{
{
private
readonly
ToDoItem
_todo
=
new
ToDoItem
();
private
ToDoItem
_todo
=
new
ToDoItem
();
public
ToDoItemBuilder
Id
(
int
id
)
public
ToDoItemBuilder
Id
(
int
id
)
{
{
...
@@ -24,6 +24,13 @@ namespace CleanArchitecture.Tests
...
@@ -24,6 +24,13 @@ namespace CleanArchitecture.Tests
return
this
;
return
this
;
}
}
public
ToDoItemBuilder
WithDefaultValues
()
{
_todo
=
new
ToDoItem
()
{
Id
=
1
,
Title
=
"Test Item"
,
Description
=
"Test Description"
};
return
this
;
}
public
ToDoItem
Build
()
=>
_todo
;
public
ToDoItem
Build
()
=>
_todo
;
}
}
}
}
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