-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Ogooreck version to 0.2.1, adjusted other tests to the new tests convention
- Loading branch information
1 parent
b3f257f
commit 3fd95e1
Showing
44 changed files
with
585 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/AcknowledgeResolutionIncidentTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Helpdesk.Api.Incidents; | ||
using Helpdesk.Api.Tests.Incidents.Fixtures; | ||
using Xunit; | ||
using static Ogooreck.API.ApiSpecification; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents; | ||
|
||
public class AcknowledgeResolutionIncidentTests: IClassFixture<ApiWithResolvedIncident> | ||
{ | ||
[Fact] | ||
[Trait("Category", "Acceptance")] | ||
public async Task ResolveCommand_Succeeds() | ||
{ | ||
await API | ||
.Given( | ||
URI($"/api/customers/{API.CustomerId}/incidents/{API.IncidentId}/acknowledge"), | ||
HEADERS(IF_MATCH(2)) | ||
) | ||
.When(POST) | ||
.Then(OK); | ||
|
||
await API | ||
.Given(URI($"/api/incidents/{API.IncidentId}")) | ||
.When(GET) | ||
.Then( | ||
OK, | ||
RESPONSE_BODY( | ||
API.Details with | ||
{ | ||
Status = IncidentStatus.ResolutionAcknowledgedByCustomer, | ||
Version = 3 | ||
} | ||
) | ||
); | ||
} | ||
|
||
private readonly ApiWithResolvedIncident API; | ||
|
||
public AcknowledgeResolutionIncidentTests(ApiWithResolvedIncident api) => API = api; | ||
} |
40 changes: 40 additions & 0 deletions
40
Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/AssignAgentTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Helpdesk.Api.Tests.Incidents.Fixtures; | ||
using Xunit; | ||
using static Ogooreck.API.ApiSpecification; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents; | ||
|
||
public class AssignAgentToIncidentTests: IClassFixture<ApiWithLoggedIncident> | ||
{ | ||
[Fact] | ||
[Trait("Category", "Acceptance")] | ||
public async Task AssignAgentCommand_ChangesIncidentCategory() | ||
{ | ||
await API | ||
.Given( | ||
URI($"/api/agents/{agentId}/incidents/{API.IncidentId}/assign"), | ||
HEADERS(IF_MATCH(1)) | ||
) | ||
.When(POST) | ||
.Then(OK); | ||
|
||
await API | ||
.Given(URI($"/api/incidents/{API.IncidentId}")) | ||
.When(GET) | ||
.Then( | ||
OK, | ||
RESPONSE_BODY( | ||
API.Details with | ||
{ | ||
AgentId = agentId, | ||
Version = 2 | ||
} | ||
) | ||
); | ||
} | ||
|
||
private readonly Guid agentId = Guid.NewGuid(); | ||
private readonly ApiWithLoggedIncident API; | ||
|
||
public AssignAgentToIncidentTests(ApiWithLoggedIncident api) => API = api; | ||
} |
46 changes: 46 additions & 0 deletions
46
Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/CategoriseIncidentTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Bogus; | ||
using Helpdesk.Api.Incidents; | ||
using Helpdesk.Api.Incidents.GetIncidentDetails; | ||
using Helpdesk.Api.Tests.Incidents.Fixtures; | ||
using Xunit; | ||
using static Ogooreck.API.ApiSpecification; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents; | ||
|
||
public class CategoriseIncidentTests: IClassFixture<ApiWithLoggedIncident> | ||
{ | ||
[Fact] | ||
[Trait("Category", "Acceptance")] | ||
public async Task CategoriseCommand_ChangesIncidentCategory() | ||
{ | ||
await API | ||
.Given( | ||
URI($"/api/agents/{agentId}/incidents/{API.IncidentId}/category"), | ||
BODY(new CategoriseIncidentRequest(category)), | ||
HEADERS(IF_MATCH(1)) | ||
) | ||
.When(POST) | ||
.Then(OK); | ||
|
||
await API | ||
.Given(URI($"/api/incidents/{API.IncidentId}")) | ||
.When(GET) | ||
.Then( | ||
OK, | ||
RESPONSE_BODY( | ||
API.Details with | ||
{ | ||
Category = category, | ||
Version = 2 | ||
} | ||
) | ||
); | ||
} | ||
|
||
private readonly Guid agentId = Guid.NewGuid(); | ||
private readonly IncidentCategory category = new Faker().PickRandom<IncidentCategory>(); | ||
private readonly ApiWithLoggedIncident API; | ||
|
||
public CategoriseIncidentTests(ApiWithLoggedIncident api) => API = api; | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/CloseIncidentTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Helpdesk.Api.Incidents; | ||
using Helpdesk.Api.Tests.Incidents.Fixtures; | ||
using Xunit; | ||
using static Ogooreck.API.ApiSpecification; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents; | ||
|
||
public class CloseIncidentTests: IClassFixture<ApiWithAcknowledgedIncident> | ||
{ | ||
[Fact] | ||
[Trait("Category", "Acceptance")] | ||
public async Task ResolveCommand_Succeeds() | ||
{ | ||
await API | ||
.Given( | ||
URI($"/api/agents/{API.AgentId}/incidents/{API.IncidentId}/close"), | ||
HEADERS(IF_MATCH(3)) | ||
) | ||
.When(POST) | ||
.Then(OK); | ||
|
||
await API | ||
.Given(URI($"/api/incidents/{API.IncidentId}")) | ||
.When(GET) | ||
.Then( | ||
OK, | ||
RESPONSE_BODY( | ||
API.Details with | ||
{ | ||
Status = IncidentStatus.Closed, | ||
Version = 4 | ||
} | ||
) | ||
); | ||
} | ||
|
||
private readonly ApiWithResolvedIncident API; | ||
|
||
public CloseIncidentTests(ApiWithAcknowledgedIncident api) => API = api; | ||
} |
Oops, something went wrong.