our application is developed by c#.NET. Its not a REST Based API. Its a token based api. our application uses mvc controller
we are from testing team. how to test mvc controller?
is there any tool?
our application is developed by c#.NET. Its not a REST Based API. Its a token based api. our application uses mvc controller
we are from testing team. how to test mvc controller?
is there any tool?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sangeetha SRank #212 · 11.4K reputationPosted Feb 4, 2025, 7:58 AM EST
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Feb 4, 2025, 11:23 AM EST
Hello Prakash,
Testing MVC controllers in a C#.NET application, especially when it's a token-based API (not REST-based), requires a combination of tools and techniques. Since your application uses MVC controllers, you can test them using both manual and automated approaches.).
Manual Testing with Tools:
Postman:
Create requests to your MVC controller endpoints.
Include the token in the request headers (e.g., Authorization: Bearer
Test different scenarios (e.g., valid/invalid tokens, different input data).
Fiddler:
Capture and inspect HTTP traffic between your client and server.
Modify requests on the fly to test edge cases.
Swagger/OpenAPI (if available):
If your application has Swagger documentation, you can use the Swagger UI to test endpoints directly.
Automated Unit Testing:
For automated testing, you can write unit tests for your MVC controllers. Use testing frameworks like xUnit, NUnit, or MSTest.
Integration Testing:
Integration tests verify the interaction between your controllers and other components (e.g., database, services). Use the Microsoft.AspNetCore.Mvc.Testing package to set up integration tests.
Load Testing:
If you need to test the performance of your MVC controllers under load, you can use tools like:
JMeter
LoadRunner
k6
By combining these tools and techniques, you can thoroughly test your MVC controllers in a token-based API environment. Let me know if you need further clarification or examples!
prakash8 reputationPosted Feb 5, 2025, 3:34 AM EST
many thanks muhammed
prakash8 reputationPosted Feb 5, 2025, 3:54 AM EST
Thanks Sangeetha for the information