diff --git a/Tests/Controllers/CatsControllerTest.cs b/Tests/Controllers/CatsControllerTest.cs index 0944b4a..62fe895 100644 --- a/Tests/Controllers/CatsControllerTest.cs +++ b/Tests/Controllers/CatsControllerTest.cs @@ -111,16 +111,8 @@ namespace cat_cafe.Controllers.Tests // Act var responseType = await controller.PutCat(bob.Id, robert); - // System.InvalidOperationException: - // The instance of entity type 'Cat' cannot be tracked because another instance - // with the same key value for {'Id'} is already being tracked. - - // ... this simple update should work out of the box, - // DbContext is already 'scoped' by default instead of singleton - // Assert responseType.Should().BeOfType(); - // responseType.Result.Should().BeOfType(); var actual = await controller.GetCat(bob.Id); var actualResult = actual.Result as OkObjectResult; actualResult!.Value.Should().BeEquivalentTo(robert); diff --git a/docs/cat_cafe.postman_collection.json b/docs/cat_cafe.postman_collection.json index 96989d7..e0fd70d 100644 --- a/docs/cat_cafe.postman_collection.json +++ b/docs/cat_cafe.postman_collection.json @@ -225,6 +225,145 @@ } }, "response": [] + }, + { + "name": "Create bar 1", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"The Black Cap\",\r\n \"catIds\" : [2, 3]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://localhost:5003/gateway/bars", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "5003", + "path": [ + "gateway", + "bars" + ] + } + }, + "response": [] + }, + { + "name": "Read all bars", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://localhost:5003/gateway/bars", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "5003", + "path": [ + "gateway", + "bars" + ] + } + }, + "response": [] + }, + { + "name": "Read all cats (v2) Copy", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://localhost:5003/gateway/cats", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "5003", + "path": [ + "gateway", + "cats" + ] + } + }, + "response": [] + }, + { + "name": "Update Bar 1", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": 1,\r\n \"name\": \"The Black Cap\",\r\n \"catIds\" : [3]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://localhost:5003/gateway/bars/1", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "5003", + "path": [ + "gateway", + "bars", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Read all bars Copy", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://localhost:5003/gateway/bars", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "5003", + "path": [ + "gateway", + "bars" + ] + } + }, + "response": [] + }, + { + "name": "Read all cats (v2) Copy 2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://localhost:5003/gateway/cats", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "5003", + "path": [ + "gateway", + "cats" + ] + } + }, + "response": [] } ] } \ No newline at end of file