-
-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Used Alba instead of Ogooreck for Wolverine sample
- Loading branch information
1 parent
c4a665f
commit fecb5e7
Showing
22 changed files
with
249 additions
and
315 deletions.
There are no files selected for viewing
40 changes: 15 additions & 25 deletions
40
Sample/Helpdesk.Wolverine/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 |
---|---|---|
@@ -1,38 +1,28 @@ | ||
using Alba; | ||
using Helpdesk.Api.Incidents; | ||
using Helpdesk.Api.Incidents.AcknowledgingResolution; | ||
using Helpdesk.Api.Tests.Incidents.Fixtures; | ||
using Xunit; | ||
using static Ogooreck.API.ApiSpecification; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents; | ||
|
||
public class AcknowledgeResolutionIncidentTests(ApiWithResolvedIncident API): | ||
IClassFixture<ApiWithResolvedIncident> | ||
public class AcknowledgeResolutionIncidentTests(AppFixture fixture): ApiWithResolvedIncident(fixture) | ||
{ | ||
[Fact] | ||
[Trait("Category", "Acceptance")] | ||
public Task ResolveCommand_Succeeds() => | ||
API | ||
.Given() | ||
.When( | ||
POST, | ||
URI($"/api/customers/{API.Incident.CustomerId}/incidents/{API.Incident.Id}/acknowledge"), | ||
BODY(new AcknowledgeResolution(API.Incident.Id)), | ||
HEADERS(IF_MATCH(2)) | ||
) | ||
.Then(OK) | ||
public async Task ResolveCommand_Succeeds() | ||
{ | ||
await Host.Scenario(x => | ||
{ | ||
x.Post.Json(new AcknowledgeResolution(Incident.Id, Incident.CustomerId, Incident.Version)) | ||
.ToUrl($"/api/customers/{Incident.CustomerId}/incidents/{Incident.Id}/acknowledge"); | ||
|
||
.And() | ||
x.StatusCodeShouldBeOk(); | ||
}); | ||
|
||
.When(GET, URI($"/api/incidents/{API.Incident.Id}")) | ||
.Then( | ||
OK, | ||
RESPONSE_BODY( | ||
API.Incident with | ||
{ | ||
Status = IncidentStatus.ResolutionAcknowledgedByCustomer, | ||
Version = 3 | ||
} | ||
) | ||
); | ||
await Host.IncidentDetailsShouldBe(Incident with | ||
{ | ||
Status = IncidentStatus.ResolutionAcknowledgedByCustomer, Version = 3 | ||
}); | ||
} | ||
} |
31 changes: 11 additions & 20 deletions
31
Sample/Helpdesk.Wolverine/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
31 changes: 10 additions & 21 deletions
31
Sample/Helpdesk.Wolverine/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
31 changes: 10 additions & 21 deletions
31
Sample/Helpdesk.Wolverine/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
11 changes: 3 additions & 8 deletions
11
...e/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithAcknowledgedIncident.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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
using Helpdesk.Api.Incidents.GettingDetails; | ||
using Ogooreck.API; | ||
using Xunit; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents.Fixtures; | ||
|
||
public class ApiWithAcknowledgedIncident: ApiSpecification<Program>, IAsyncLifetime | ||
public class ApiWithAcknowledgedIncident(AppFixture fixture): IntegrationContext(fixture), IAsyncLifetime | ||
{ | ||
public async Task InitializeAsync() | ||
{ | ||
Incident = await this.AcknowledgedIncident(); | ||
} | ||
public override async Task InitializeAsync() => | ||
Incident = await Host.AcknowledgedIncident(); | ||
|
||
public IncidentDetails Incident { get; set; } = default!; | ||
|
||
public Task DisposeAsync() => Task.CompletedTask; | ||
} | ||
|
11 changes: 4 additions & 7 deletions
11
Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithLoggedIncident.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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
using Helpdesk.Api.Incidents.GettingDetails; | ||
using Ogooreck.API; | ||
using Xunit; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents.Fixtures; | ||
|
||
public class ApiWithLoggedIncident: ApiSpecification<Program>, IAsyncLifetime | ||
public class ApiWithLoggedIncident(AppFixture fixture): IntegrationContext(fixture), IAsyncLifetime | ||
{ | ||
public async Task InitializeAsync() | ||
{ | ||
Incident = await this.LoggedIncident(); | ||
} | ||
public override async Task InitializeAsync() => | ||
Incident = await Host.LoggedIncident(); | ||
|
||
public IncidentDetails Incident { get; protected set; } = default!; | ||
public Task DisposeAsync() => Task.CompletedTask; | ||
} |
11 changes: 3 additions & 8 deletions
11
Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/Fixtures/ApiWithResolvedIncident.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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
using Helpdesk.Api.Incidents.GettingDetails; | ||
using Ogooreck.API; | ||
using Xunit; | ||
|
||
namespace Helpdesk.Api.Tests.Incidents.Fixtures; | ||
|
||
public class ApiWithResolvedIncident: ApiSpecification<Program>, IAsyncLifetime | ||
public class ApiWithResolvedIncident(AppFixture fixture): IntegrationContext(fixture), IAsyncLifetime | ||
{ | ||
public async Task InitializeAsync() | ||
{ | ||
Incident = await this.ResolvedIncident(); | ||
} | ||
public override async Task InitializeAsync() => | ||
Incident = await Host.ResolvedIncident(); | ||
|
||
public IncidentDetails Incident { get; set; } = default!; | ||
|
||
public Task DisposeAsync() => Task.CompletedTask; | ||
} | ||
|
Oops, something went wrong.