System Requirements Specification Index For Comment Management Application Version 1.0 COMMENT MANAGEMENT APPLICATION System Requirements Specification 1 P ROJECT A BSTRACT The Comment ManagementApplication is a ASP.NET Core Web API 7.0 with MS SQL Server database connectivity. It enables users to manage various aspects of Comment management. Following is the requirement specifications : Comment Management Application Modules 1 Comment Comment Module Functionalities 1 Create a Comment 2 Update the existing Comment details 3 Get the Comment by Id 4 Get all Comments 5 Delete an Comment 2 A SSUMPTIONS , D EPENDENCIES , R ISKS / C ONSTRAINTS 2.1 Comment C ONSTRAINTS ● When fetching a Comment by ID, if the Comment ID does not exist, the operation should throw a custom exception. ● When updating a Comment, if the Comment ID does not exist, the operation should throw a custom exception. ● When removing a Comment, if the Comment ID does not exist, the operation should throw a custom exception. Common Constraints ● For all rest endpoints receiving @RequestBody, validation check must be done and must throw custom exception if data is invalid ● All the database operations must be implemented on entity object only ● Do not change, add, remove any existing methods in service layer ● In Repository interfaces, custom methods can be added as per requirements. ● All RestEndpoint methods and Exception Handlers must return data wrapped in ResponseEntity 3 B USINESS V ALIDATIONS ● Refund Id (Int) Key, Not Null ● Amount (Decimal) of the Comment is not null. ● Reason (String) of the Comment is not null and should be between 5 and 200 characters in length. ● Request Date (DateTime) of the event Comment not null. ● Approved (bool) 4 R EST ENDPOINTS Rest End-points to be exposed in the controller along with method details for the same to be created 4.1 CommentC ONTROLLER URL Exposed Purpose 1. /get-all-Comments Fetches all the Comments Http Method GET Parameter - Return <IEnumerable<Comme nt>> 2. /create-Comment Add a new Comment Http Method POST Parameter 1 Comment Return Comment 3. /delete-Comment Delete Comment with given Comment id Http Method DELETE Parameter 1 Int (id) Return - 4./ get-Comment-by-id Fetches the Comment with the given id Http Method GET Parameter 1 Int (id) Return Comment 5. /update-Comment Updates existing Comment Http Method PUT Parameter 1 Int (id) Parameter 2 Comment Return Comment 5. T EMPLATE C ODE S TRUCTURE 5.1 Package: CommentManagementApp Resources Names Resource Remarks Status Package Structure controller Comment Controller Controller class to expose all rest-endpoints for auction related activities. Partially implemented Program.cs Program.cs file Contain all Services settings and SQL server Configuration. Already Implemented Interface ICommentService, interface Inside all these interface files contains all business validation logic functions. Already Implemented Service CommentService CS file file Using this all class we are calling the Repository method and use it in the program and on the controller. Partially Implemented Repository ICommentRepository CommentRepository CS file and interface. All these interfaces and class files contain all CRUD operation code for the database. Need to provide implementation for service related functionalities Partially Implemented Models Comment cs file All Entities/Domain attribute are used for pass the data in controller. Already Implementation 5.2 Package: CommentManagementApp.Tests Resources The CommentManagementApp.Tests project contains all test case classes and functions for code evaluation. Don’t edit or change anything inside this project. 6. E XECUTION S TEPS TO F OLLOW 1. After successfully cloning the project template on the desktop, you will be able to see the folder created containing project files. This folder contains all the source files needed to start working on your project. 2. Go to below path and open solution file with Visual Studio. Path: newly-created-project-folder > CommentManagementApp > CommentManagementApp.sln Open with Microsoft Visual Studio 2022 3. All actions like build, compile, running application, running test cases will be through Command Terminal. 4. To open the command terminal the test takers need to go to (Top horizontal menu bar) View → Terminal. 5. To connect SQL server from terminal: (CommentManagementApp / sqlcmd -S localhost -U sa -P pass@word1 ) - To create database from terminal - 1> Create Database CommentDb 2> Go 6. Steps to Apply Migration(Code first approach): - Press Ctrl+C to get back to command prompt - Run following command to apply migration- (CommentManagementApp / dotnet-ef database update ) 7. To check whether migrations are applied from terminal: (CommentManagementApp / sqlcmd -S localhost -U sa -P pass@word1 ) 1> Use CommentDb 2> Go 1> Select * From __EFMigrationsHistory 2> Go 8. To build your project use command: (CommentManagementApp / dotnet build ) 9. To launch your application, Run the following command to run the application: (CommentManagementApp / dotnet run ) (Note: After running this command, you will get one URL in terminal) 10. To test any Restful application, you can use POSTMAN. (e.g. http://localhost:5104/get-all-comments) 11. To test any applications on a browser, use the internal browser in the workspace. 12. To run the test cases in CMD, Run the following command to test the application: (CommentManagementApp.Tests/ dotnet test --logger "console;verbosity=detailed" ) (You can run this command multiple times to identify the test case status,and refactor code to make maximum test cases passed before final submission) Note: Navigate to the CommentManagementApp.Tests folder using the following commands: ● Type cd .. to move up to the project root directory. ● Then type cd CommentManagementApp.Tests to enter the test project folder. ● Once inside the CommentManagementApp.Tests directory, run the following command to execute all test cases: dotnet test --logger "console;verbosity=detailed" NOTE: Understanding Test Case Summary Output ● The terminal shows the overall summary — e.g., Total tests: 10, Passed: 10 ⚠ This does not mean all test validations are correct — it only means all test methods executed successfully without errors. ● The actual pass or fail status of individual test methods is shown above the summary, where each test method is listed with its result: ○ Example: ■ Testfor_Get_Comment_ById: Failed ■ Testfor_Comment_Rating_NotEmpty: Passed ● Always check the detailed section above the summary to know which specific test cases passed or failed, as the total count only indicates that the execution completed.