Skip to content

Commit 6dcf7d8

Browse files
committed
Improve test and doc
1 parent c510166 commit 6dcf7d8

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

samples/terraform-local-exec/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Terraform with local-exec
22

3-
## Run the sample
3+
## Setup
4+
5+
Run the application, from the command line or the IDE.
6+
7+
[Terraform binary](https://developer.hashicorp.com/terraform/install) is the only other tool required on the machine.
8+
9+
## Workflow
410

511
Go to the sample directory:
612

test/WebApi.IntegrationTests/Resources/StateControllerResourceTest.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@ public async Task StateResource_GetNotExisting_ReturnsNoContent()
2323
}
2424

2525
[Fact]
26-
public async Task StateResource_CreateNew_ReturnsCreated()
26+
public async Task StateResource_CreateFindDelete_IsSuccess()
2727
{
2828
// Arrange
2929
var client = CreateClient(true);
3030
var name = Faker.Random.Word();
31-
var lockId = Faker.Random.Guid().ToString();
3231
var payload = GeneratePayload();
3332

34-
// Act
35-
var response = await client.PostAsync($"/state/{name}?ID={lockId}", payload);
36-
37-
// Assert
33+
// Act & Assert
34+
var createResponse = await client.PostAsync($"/state/{name}", payload);
3835
//TODO: test resource URL in response
39-
await response.CheckResponseAndGetContent(HttpStatusCode.OK, null, string.Empty);
36+
await createResponse.CheckResponseAndGetContent(HttpStatusCode.OK, null, string.Empty);
37+
var findResponse = await client.GetAsync($"/state/{name}");
38+
await findResponse.CheckResponseAndGetContent(HttpStatusCode.OK, "text/plain; charset=utf-8");
39+
var deleteResponse = await client.DeleteAsync($"/state/{name}");
40+
await deleteResponse.CheckResponseAndGetContent(HttpStatusCode.OK, null);
4041
}
4142

4243
[Fact]

0 commit comments

Comments
 (0)