Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-3 votes
1 answer
50 views

Crystal Report generates reports correctly in parallel on IIS but throws System.Runtime.InteropServices.COMException in NUnit test

When running NUnit test to check if multiple PDF reports have been generated correctly the following exception is being thrown System.Runtime.InteropServices.COMException : Invalid index. (Exception ...
Nikola's user avatar
  • 127
0 votes
2 answers
147 views

Create a unit test to verify data from a SQL view in a .NET EF Core project

We created an API, which will fetch data from a SQL view created in the database. Here is the repository code: List<Entities.MyView> reportsData = await ( from r in _context.MyView where ...
Kotana Sai's user avatar
  • 1,843
0 votes
0 answers
282 views

Wrong Appsettings.json picked at build with Unit test project referencing another project with its own appsettings

With Visual Studio 2022 in C#, we are referencing from our Unit tests project another project which is a WebApplication. The web application is tested using Microsoft's WebApplicationFactory ASP.Net ...
AFract's user avatar
  • 9,750
1 vote
1 answer
49 views

NUnit : How to prevent calling base class constructor or mocking base class constructor (ASP.NET MVC controller method testing with NUnit)

I am testing an ASP.NET MVC application with NUnit (on the .NET framework). I am trying to test SomeController method which is inheriting from BaseController. In BaseController, there is a ...
Man Mohan Mundhra's user avatar
1 vote
1 answer
1k views

How to write unit test case and Mock SmtpClient Send mail

I am writing unit test case for the below class Communication service. I have the below interface communicationservice . I want to write the Nunit or unit test for the SendMail method which is present ...
Bash's user avatar
  • 13
0 votes
1 answer
413 views

How to mock the class method using NUnit test

Please let me know How do I Mock my "GetStatus" method which is available inside my controller. This is my Test Method public async Task ShouldReturnOKStatus() { var ...
Shankar's user avatar
  • 71
1 vote
1 answer
1k views

Print all test cases along with passed/failed using dotnet test/nunit console runner

I'm looking to print all the test cases along with their status(pass/fail) like below: TestCaseOne --> Passed TestCaseTwo --> Failed TestCaseThree --> Passed I have tried this from this link ...
user avatar
0 votes
1 answer
338 views

How to run a web application project (ASP.NET MVC) within C#, NUnit project in Visual Studio 2022

I'm building a NUnit test project in Visual Studio (VS) 2022 in order to test an older web site (MVC 4, ASP.NET). I would like to run a Selenium WebDriver to test the older, MVC 4, web application in ...
Tom C's user avatar
  • 43
0 votes
1 answer
179 views

I am Testing User Manager Functionality in asp. Net core clean Architecture, but user Manager method addClaim not working

I am mocked the UserStore and userManager and getting User by userManager method FindByIdAsync Correctly but when I send That User and one claim to AddClaim Function Its Giving me null value. Here Is ...
IkramK's user avatar
  • 3
0 votes
1 answer
148 views

AutoTest of all mappings in AutoMapperProfiles C#

The question is to make a test that will look at each mapping from the MapperProfile and do a mapping test through .Map(model) For Example: private static IMapper _mapper; public MappingAll() { ...
giveyourtears's user avatar
0 votes
1 answer
776 views

How to pass multiple tests names, as one value in "dotnet test --filter" option

I have this part of my feature scenarios @ID-1 @Browser:Edge @Browser:Chrome Given Scenario: 01.01 Given I have open website in Browser When I open form Then the element are visible @ID-2 ...
maksim korshikov's user avatar
1 vote
1 answer
803 views

Dotnet test coverage always null

I have an issue with test coverage. When I run this command dotnet test ../XZrcndee.sln --output ../coverage /p:CollectCoverage=true /p:CoverletOutput=results\coverage /p:CoverletOutput=..\results\...
Udemytur's user avatar
  • 351
0 votes
1 answer
582 views

No connection string could be found in the App.config file

Visual Studio Solution: (Project 1) I have a ASP .NET Framework API project that uses Entity Framework to access to Database. (Project 2) Now I created NUnit project that is calling methods of project ...
E. Williams's user avatar
0 votes
1 answer
443 views

No suitable constructor was found using Playwright with NUnit

I have a base class as public class PlaywrightFixture { public Task<IPlaywright> Playwright { get; set; } = default; public Task<IBrowser> Browser { get; set; } = ...
San Jaisy's user avatar
  • 17.2k
0 votes
2 answers
4k views

c# unit test httpclient postasync

I am very new to Testing. I am trying to understand how can I unit test since I do not really need to actually trigger these services but probably mock every step. How can I unit test the following ...
xtc's user avatar
  • 63

15 30 50 per page
1
2 3 4 5
12