Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Xunit testing of ASP 5 MVC applications

$
0
0

Hi. I have a trouble. I'm trying to test controller via xUnit. I have created test library. Add all references. In test method I'm invoking TestServer instance of Asp.Net 5 application. Test launching controller action but when it goes to return View (return type is IActionResult) I got the next exception in test method around "await client.SendAsync(request)": "The view 'Index' was not found. The following locations were searched:\r\n/Views/Home/Index.cshtml\r\n/Views/Shared/Index.cshtml.". I have View Index in Views->Home. Also I have tried default template with already added views. the same result. The goal of test is to get an html string. Could anybody help? Thanks


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>