Conversation
Controller
… into development
… to all the API's.
… discount(offer) for each hotels.
…te menu feature added.
feat: Add Discount update Api
Customer xunit test
Vasantha-Kumar-J
left a comment
There was a problem hiding this comment.
Add proper description to the PR.
There was a problem hiding this comment.
Update the Final Name with proper casing. For Instance, Test should be capitalized.
There was a problem hiding this comment.
The same is the case for the containing folder.
There was a problem hiding this comment.
Changes done in naming the project files and the respective folders.
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="coverlet.collector" Version="3.2.0"> |
There was a problem hiding this comment.
What is the need for the Usage of Coverlet?
There was a problem hiding this comment.
It gets added automatically while creating an xunit project, used for code coverage.
|
|
||
| namespace Controllers.test | ||
| { | ||
| public class CustomerController_UnitTesting |
There was a problem hiding this comment.
Class names generally should not contains _.
There was a problem hiding this comment.
Updated and checked the class names.
| mapper = _mapper; | ||
| _sut = new CustomerController(_serviceMock.Object, mapper, logger); | ||
| } | ||
| [Fact] |
There was a problem hiding this comment.
Leave Space between constructor and method.
| results.Should().NotBeNull(); | ||
| results.Value.Should().BeAssignableTo<IEnumerable<OrderDTO>>(); | ||
| results.Should().BeAssignableTo<OkObjectResult>(); | ||
| } |
There was a problem hiding this comment.
Leave one line space between methods.
| { | ||
| public class TestRestaurantServices : IDisposable | ||
| { | ||
| protected readonly FakeFoodApiDbContext _context; |
There was a problem hiding this comment.
It is generate with the help of Intellisense while creating the constructor.
| } | ||
|
|
||
| [HttpPost("PlaceOrder")] | ||
| [ValidateModel] |
There was a problem hiding this comment.
Why not use this attribute for other actions also?
There was a problem hiding this comment.
Here, we are receiving it as list of object, So, we have used ValidateModel attribute.
For other actions, either Guid or string is validated while receiving (using [Required]).
| { | ||
| public class DbDataProvider : Controller, IDataProvider | ||
| { | ||
| private readonly IDbProvider foodApiDbContext; |
There was a problem hiding this comment.
All private variables should start with _. Please check all the other locations and update the same,
There was a problem hiding this comment.
Checked and updated all the private fields
FoodOrderApi/Program.cs
Outdated
|
|
||
| app.Run(); | ||
|
|
||
| public static class MyExtensions |
There was a problem hiding this comment.
Rename this class with the proper Name.
MockData.cs
Outdated
| @@ -0,0 +1,8 @@ | |||
| using System; | |||
|
|
|||
There was a problem hiding this comment.
What is the use of this class? Remove this class if not used.
There was a problem hiding this comment.
We have removed the class. It was created by mistake.
Title: Online Food Ordering Web API
Description:
This PR introduces the Online Food Ordering Web API, which allows users to order food from various restaurants. The API provides endpoints for retrieving menus, placing orders, changing order status, and includes search, filtering, updating, deleting, and tracking order functionalities.
Key Features:
- Added RESTful endpoints for retrieving menus, placing orders, and managing order status.
- Provision for adding menu items for a particular restaurant.
- Implemented search functionality to allow users to search for specific menu items or restaurants.
- Integrated filtering options to enable users to filter restaurants.
- Implemented update endpoints to modify existing order delivery status.
- Functionality for deleting Menu item and updating the Discount for the particular menu.
- Added order tracking functionality, allowing users to monitor the status of their orders in real-time.
Testing:
- Conducted unit tests to ensure the correctness and robustness of the API endpoints.
- Performed integration tests to verify the seamless integration with the database and other dependencies.
- Manually tested various scenarios including placing orders, updating order status, and retrieving menus to validate
the API's behavior.
Dependencies:
-Utilizes a database system for storing menus, orders and restaurant details.
Known Issues:
-None at the moment.
Request for Review:
-Please review the implementation of the Online Food Ordering Web API.
-Pay particular attention to the architecture, endpoint design, data validation and adherence to best practices.
-Any feedback or suggestions for improvements are highly appreciated.
Mentioning:
@Vasantha-Kumar-J
@vigkre
API Credits:
@Sathika-J
@Aravindhan-soliton
@arun1412-dev