I’m using the Microsoft Edge WebDriver to test inprivate browser windows but I’ve noticed 2 things:
WebDriver process does not always end
When running more than 1 at a time, taking screenshots often fail once the first web driver has been disposed…
I have a suite of system tests that are driven by XUnit (2.x). These run against a freshly deployed set of microservices.
(I know many feel that tests shouldn't have an order dependency and should be independent, but what we have works well as a…
I have a complex object several levels deep. Marking my Xunit theory with this custom attribute and passing the complex object to the method as a parameter populates all the properties with test data…
It should be simple, but I am not able to make it.
Setup
.NET 6 class library
xUnit 2.4.1 as a test framework
Everything is nice.
I am trying to execute all my unit tests before committing.
If any unit test failed I will prevent the commit.
I am…
I am using the AutoDataAttribute class within AutoFixture.Xunit2 in a lot of projects. The recommended approach to add your own customizations seems to be a derived attribute like the following (note I am using FakeItEasy):
public class…
My tests in Selenium Xunit 2.0 from different collection class run parallel and dispose method call once only. I want to call to dispose the method after each test run even if they run in parallel.
[TestClass]
public class Basic : IDisposable
…
When trying to run a test case that uses the xunit framework through Visual Studio I am currently getting the following error.
System.InvalidCastException
HResult=0x80004002
Message=Specified cast is not valid.
…
I have created a custom xUnit theory test DataAttribute named RoleAttribute:
public class RoleAttribute : DataAttribute
{
public Role Role { get; set; }
public RoleAttribute(Role role, Action method)
{
Role = role;
…
I'm new in unit testing, Below is code for unit testing using xunit
public class FloorManager
{
public List Floors { get; }
public FloorManager()
{
Floors = new List();
SelectedFloor = -1;
} …
Need code to write xunit test case for ControllerApi
I tried to inject Contructor from xunit test method, but it asking contructor value which I don't have in test method.
Controller
ItemApiController.cs
public class ItemApiController :…
I have a profile class where I am using AfterMap() method. My profile class has two constructor dependencies. Problem is that while I am unit testing I am mocking these dependencies but also I require the actual objects when I am doing integration…
xUnit2 runs all tests in parallel, so for this reason I want to ensure that all my automapper profiles are loaded first, in order to get a successful mapping while running the tests. This is what I have done
public static class…
I have been facing an unusual problem, in my unit test project I am getting this error, also the strange thing is some tests which normally pass, fail in next run. With this error I am also getting AutoMapperMappingExceptions, although I am trying…