Skip to content

Commit f00ec24

Browse files
authored
Fix broken unit test
- Fix broken unit test - Update workflow triggers
1 parent f6e035b commit f00ec24

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

.github/workflows/dotnet-continuous-integration.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,27 @@ name: Continuous Integration
22
run-name: CI ${{ github.ref_name }}
33

44
on:
5+
pull_request:
6+
branches:
7+
- "feature/*"
8+
- "fix/*"
9+
510
pull_request_target:
6-
branches: ["develop"]
7-
types: [opened, closed]
11+
branches:
12+
- "develop"
13+
types:
14+
- closed
15+
816
push:
9-
branches: ["feature/*"]
17+
branches:
18+
- "feature/*"
19+
- "fix/*"
1020
paths:
1121
- "src/**"
1222
- "tests/**"
1323

1424
concurrency:
15-
group: ci-${{ github.workflow }}-${{ github.actor_id }}
25+
group: ci-${{ github.workflow }}-${{ github.ref_name }}
1626
cancel-in-progress: true
1727

1828
jobs:

tests/InvvardDev.Ifttt.Tests/Controllers/TestSetupControllerTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public async Task SetupTest_WhenProcessorHasNoDataField_ShouldReturn200OKWithEmp
7474
.Subject.Value.Should().BeEquivalentTo(expectedBody);
7575
}
7676

77-
[Fact(DisplayName = "SetupTest when there is an exception, should log an error and return 500InternalServerError")]
78-
public async Task SetupTest_WhenThereIsAnException_ShouldReturn500InternalServerError()
77+
[Fact(DisplayName = "SetupTest when there is an exception, should log an error and return 400 Bad Request")]
78+
public async Task SetupTest_WhenThereIsAnException_ShouldReturn400BadRequestError()
7979
{
8080
// Arrange
8181
const string expectedErrorMessage = "Error while setting up test";
@@ -101,12 +101,12 @@ public async Task SetupTest_WhenThereIsAnException_ShouldReturn500InternalServer
101101
result.Should()
102102
.NotBeNull()
103103
.And.Subject.Should()
104-
.BeOfType<ObjectResult>()
104+
.BeOfType<BadRequestObjectResult>()
105105
.Subject.StatusCode.Should()
106-
.Be(StatusCodes.Status500InternalServerError);
106+
.Be(StatusCodes.Status400BadRequest);
107107

108-
result.As<ObjectResult>().Value.Should().BeOfType<ProblemDetails>()
109-
.Which.Detail.Should().Be(expectedErrorJson);
108+
result.As<BadRequestObjectResult>().Value.Should().BeOfType<string>()
109+
.Which.Should().Be(expectedErrorJson);
110110
}
111111

112112
[Fact(DisplayName = "SetupTest when processor has data field, should return 200OK with samples processor payload")]

0 commit comments

Comments
 (0)