Navigation
Markdown version available here
Task 1
This task is to enable simple CRUD operations on a web server.
The testing documentation has links that section of code that was tested.
Requirements
Practical 2 Part 2 Enable CRUD operations in ASP.NET Web API
Practical 3 Part 1 Validate WEB API Input using Annotation
Code
The code for Task 1 can be found in this branch
Dependencies Used
Microsoft.AspNet.WebApi.Cors
This package enables Cross-Origin Resource Sharing (CORS) in ASP.NET Web API
Nuget package manager Install-Package Microsoft.AspNet.WebApi.Cors
Sequence Diagram
V1 APIs
Code to generate sequence diagram using js-sequence-diagrams
Title: ProductsV1 APIs
User->Browser: Visits http://localhost:55905/API/V1/Products
Browser->ProductsV1Controller: [HttpGet]GetAllProducts
ProductsV1Controller->Browser: return Products
Browser->User: return XML file with all Products
User->Browser: Visits http://localhost:55905/API/V1/Products/2
Browser->ProductsV1Controller: [HttpGet]GetProduct
ProductsV1Controller->Browser: return Product
Browser->User: return XML file with requested Product
V2 APIs
Code to generate sequence diagram using js-sequence-diagrams
Title: ProductsV2 APIs
User->Browser: Visits http://localhost:55905/API/V2/Products
Browser->ProductsV2Controller: [HttpGet]GetAllProducts
ProductsV2Controller->Browser: return Products
Browser->User: return XML file with all Products
User->Browser: Visits http://localhost:55905/API/V2/Products/2
Browser->ProductsV2Controller: [HttpGet]GetProduct
ProductsV2Controller->Browser: return Product
Browser->User: return XML file with requested Product
User->Browser: Post http://localhost:55905/API/V2/Products/
Browser->ProductsV2Controller: [HttpPost]PostProduct
Note over ProductsV2Controller: ValidateModel
ProductsV2Controller->Browser: return new Product
Browser->User: return XML file with newly created Product
Testing
V1 APIs
Web

Get

Get by id

V2 APIs
Get

Get by id

Get by category

Post

Put

Delete

V3 APIs
Difference between V2 and V3 controller
Get

Post

//Did not screenshot the test conducted on the other crud operations but they should be similar to V2 due to similar implementations but with different return messages.
©2018 francisyzy - Github