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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sangeetha SPosted Feb 4, 2025, 12:58 PM
prakashPosted Feb 5, 2025, 8:54 AM
Thanks Sangeetha for the information
prakashPosted Feb 5, 2025, 8:34 AM
many thanks muhammed
Muhammad Imran AnsariPosted Feb 4, 2025, 4:23 PM
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!