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
877ca99a
Commit
877ca99a
authored
Aug 23, 2019
by
Steve Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding tests and refactoring handler
parent
e782a7a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
CleanArchitecture.sln
CleanArchitecture.sln
+5
-0
ItemCompletedEmailNotificationHandler.cs
...re.Core/Handlers/ItemCompletedEmailNotificationHandler.cs
+1
-1
SomeDomainService.cs
src/CleanArchitecture.Core/Services/SomeDomainService.cs
+7
-0
ItemCompletedEmailNotificationHandlerHandle.cs
...e/Handlers/ItemCompletedEmailNotificationHandlerHandle.cs
+27
-0
No files found.
CleanArchitecture.sln
View file @
877ca99a
...
@@ -15,6 +15,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArchitecture.Web", "sr
...
@@ -15,6 +15,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArchitecture.Web", "sr
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArchitecture.Tests", "tests\CleanArchitecture.Tests\CleanArchitecture.Tests.csproj", "{AEE17BAB-D187-4BC5-B640-40CC0749566C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArchitecture.Tests", "tests\CleanArchitecture.Tests\CleanArchitecture.Tests.csproj", "{AEE17BAB-D187-4BC5-B640-40CC0749566C}"
EndProject
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{250F283E-FE2F-4BBD-9E63-A2265B84E23F}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
EndProjectSection
EndProject
Global
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Any CPU = Debug|Any CPU
...
...
src/CleanArchitecture.Core/
Services/ToDoItemService
.cs
→
src/CleanArchitecture.Core/
Handlers/ItemCompletedEmailNotificationHandler
.cs
View file @
877ca99a
...
@@ -4,7 +4,7 @@ using CleanArchitecture.Core.Interfaces;
...
@@ -4,7 +4,7 @@ using CleanArchitecture.Core.Interfaces;
namespace
CleanArchitecture.Core.Services
namespace
CleanArchitecture.Core.Services
{
{
public
class
ToDoItemService
:
IHandle
<
ToDoItemCompletedEvent
>
public
class
ItemCompletedEmailNotificationHandler
:
IHandle
<
ToDoItemCompletedEvent
>
{
{
public
void
Handle
(
ToDoItemCompletedEvent
domainEvent
)
public
void
Handle
(
ToDoItemCompletedEvent
domainEvent
)
{
{
...
...
src/CleanArchitecture.Core/Services/SomeDomainService.cs
0 → 100644
View file @
877ca99a
namespace
CleanArchitecture.Core.Services
{
public
class
SomeDomainService
{
// TODO: This would handle operations involving multiple aggregates or entities
}
}
tests/CleanArchitecture.Tests/Core/Handlers/ItemCompletedEmailNotificationHandlerHandle.cs
0 → 100644
View file @
877ca99a
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.Core.Events
;
using
CleanArchitecture.Core.Services
;
using
System
;
using
Xunit
;
namespace
CleanArchitecture.Tests.Core.Entities
{
public
class
ItemCompletedEmailNotificationHandlerHandle
{
[
Fact
]
public
void
ThrowsExceptionGivenNullEventArgument
()
{
var
handler
=
new
ItemCompletedEmailNotificationHandler
();
Exception
ex
=
Assert
.
Throws
<
ArgumentNullException
>(()
=>
handler
.
Handle
(
null
));
}
[
Fact
]
public
void
DoesNothingGivenEventInstance
()
{
var
handler
=
new
ItemCompletedEmailNotificationHandler
();
handler
.
Handle
(
new
ToDoItemCompletedEvent
(
new
ToDoItem
()));
}
}
}
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