© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
2 replies
clownshark5503

Unit Testing(post request) confusion with ActionResult[Solved]

Hello! I've written a unit test for a post request method which inserts a record into a database(postgres).
When I examine the variable
result
result
its says the status code is 201.

However I get a error message(included in the second screen shot) telling me ActionResult does not contain a definition for StatusCode.

Something is flying over my head but I haven't been able to figure that out myself. Can anyone point me in the right direction?
Thank you!
Screenshot_606.png
Screenshot_607.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Unit Testing with NUnit
C#CC# / help
2y ago
unit testing
C#CC# / help
2y ago
Unit testing
C#CC# / help
2y ago
✅ Unit testing
C#CC# / help
3y ago