Moq is a strongly typed and minimalistic mocking framework for .NET.
I really appreciate Moq's Loose mocking behaviour that returns default values when no expectations are set. It's convenient and saves …
unit-testing moqI'm trying to mock a repository's method like that public async Task<WhitelistItem> GetByTypeValue(WhitelistType type, string value) …
c# unit-testing moqGiven an interface IService that has Method1() and Method2(). I want to test that when Method1() throws an Exception, Method2() …
c# .net unit-testing nunit moqI'm building a Web API in ASP.NET Core, and I want to unit test the controllers. I inject an …
c# unit-testing asp.net-core moq asp.net-core-webapiI am attempting to write a test for a Web API method that uses HttpContext.Current.Request.Files and after …
c# unit-testing asp.net-web-api moq httpcontextI am using ASP.NET Core 2.2, EF Core and MOQ. When I run the test I am getting this error: …
c# unit-testing asp.net-core entity-framework-core moqI am working on this WebAPI project and I need to create unit tests for it. The base of the …
c# unit-testing asp.net-web-api moq xunitI am trying to unit test my controller code which gets the information from the ClaimsPrincipal.Current. In the controller …
c# .net unit-testing asp.net-mvc-5 moqI have a couple of ActionMethods that queries the Controller.User for its role like this bool isAdmin = User.IsInRole("…
c# asp.net-mvc unit-testing mocking moq