I have the following method I wish to unit test: public class Board { public static BoardElement RandomElement(List<BoardElement> elements) {
I´m trying to test this Angular service which uses af.firestore.collection, not just af.collection, as shown below, so to be able to access the onSnapshot
Question is exactly same here in fact but has different context: How to mock not installed npm package in jest? I am part of a project where new Module Federati
I have the following code, which is used to (sha) hash columns in a spark dataframe: import org.apache.spark.sql.DataFrame import org.apache.spark.sql.functions
public ngOnDestroy(): void { window.location.reload(); } How can I unit test this? All answers I found didn't work or only worked when the test was the only on
I'm facing a problem when I want to run unit test on my c# project. I have the same behaviour using Visual Studio or command line. Here's my process: Ensure tha
I have a NodeJS application and I'm trying to write some tests. Currently, I'm trying to stub Firebase. Current code: sinon.stub(firebase, 'initializeApp'); con
Why is functional style testing facilitating testing compared to class based testing? Is this just additional library specific functionality or are there any ge
I have a function that calls a gRPC endpoint, converts the objects into POCO objects and returns them as a list. public class ActionPlanConnectionsService : ICo
I have some difficulties in unit testing a function. I'm new in these things and I don't know what I can do. I have to those 2 if. Any advice? Thank you.
I am running this test case command below py.test --cov-report term-missing --cov=pipelines/core/comp/plugins/abc/ --noconftest pipelines/core/comp/test/plugins
I'm trying to test that two async functions. The problem is that one of the functions is called every 10 seconds automatically. I tried to use tick() or flush()
I have a bunch of test modules and I can run a specific one using cabal test. cabal test Module.Name.Here The module contains many tests and one of them fails
I'm testing Django forms handling and trying to test a ModelForm, which form edits the user's data. I tried to write the test in several ways, but each one thro
I'm writing a simple test to assert if an api endpoint response returns with 200 status. My api got Bearer authentication through sanctum middleware. My test fu
I am testing a function that has a reference to a form in it (this.form), so when I try to test it I am wondering how I can mock that form so the function has a
I'm using Spring Boot and in a unit test, I'm trying to mock the Files.delete(myFile.toPath()) method. To do so I'm trying to use the Mockito.mockStatic() metho
I would like to run ansi C unit tests in VS by mean of Test Explorer (not only with Console). I saw that it's possible for C++ projects (https://docs.microsoft.
I had a mocked bean in a configuration: @Profile('test') @Configuration class TestSecurityConfig { private final mockFactory = new DetachedMockFactory() @Pr
I am pretty new at unit tests and have seen fairly basic examples of mocks and doing asserts that test the return value of a function. I have a fairly advanced