85,838
questions
1
vote
1
answer
17
views
Angular / Jasmine Error Messages are not the same--Quoted?
I am trying to run a test using Angular/Jasmine.
Here is my function:
ValidateX(value : number) {
if (value > 5) {
throw new Error('Number is greater than 5');
}
} ...
0
votes
0
answers
9
views
How to mock async functions with unittest
I want to test a function like this, with pytest:
def asdf():
a = first_function()
b = second_function()
where a has a block like this:
result_queue_first = queue.Queue()
result_queue_second =...
-1
votes
0
answers
48
views
Mock a function inside a unit function in C
I have a code.c file with this content
void Unit()
{
func1();
return;
}
I would like to call this function in main.c like this
int main()
{
int input;
cin>>input;
Unit();
...
1
vote
1
answer
27
views
How do I test ngOnInit in Angular?
I'm using Angular and Jasmine. I've coded an edit form for an entity called a trainer. My ngOnInit function grabs the trainer id from the url and then makes a service call to grab the trainer from the ...
-1
votes
0
answers
26
views
Important Things to Consider When Migrating From Android Studio to Visual Studio Code in Mobile/Cross Platform Development
I am now more preferred to use Visual Studio Code as my main IDE for development, but I actually started developing mobile app in Android Studio and I've noticed the ease of use of it, particularly in ...
0
votes
0
answers
14
views
Csharp xunit Test case failing for Amazons3 Class methods(GetPreSignedURL,PutObjectAsync,ListObjectsV2Async)
I have Amazons3 class with its methods (GetPreSignedURL,PutObjectAsync,ListObjectsV2Async) . I am trying to Mock them using Moq in C# Xunit . But it is failing in the calling method.
AmazonS3 Class ...
0
votes
1
answer
15
views
Mockk unable to verify lambda that takes a data class as an argument
import io.mockk.verify
import org.junit.jupiter.api.Test
class DummyTest {
@Test
fun `dummy test to show issue with mockk`() {
val lambdaFunc: (SomeDataClass) -> Unit = { }
...
0
votes
1
answer
23
views
Flutter Unit Test With Localization
I have a utility class that relies on the context in order to translate the output.
Something along the lines of :
static String doSomeLogicAndTranslate(String firstArg, BuildContext context) {
//....
0
votes
1
answer
22
views
How to Mock EntityEntry in EF Core?
I am trying to write a unit test for a method that handles exceptions and reloads an entity in Entity Framework Core. The method contains the following code:
catch (DbUpdateConcurrencyException)
...
-1
votes
1
answer
42
views
Is Swift Testing Available on iOS 15?
I’m planning to integrate the new Swift Testing framework into my iOS application. My minimum deployment target is iOS 15, and I wanted to know if Swift Testing is fully compatible with this version ...
-1
votes
1
answer
36
views
Unit test ArgumentOutOfRangeException when compiling my Bowling Code kata
public class Game
{
private IOutputProvider _outputProvider;
private List<Frame> frames = new List<Frame>();
private int currentRoll = 0;
public Game(IOutputProvider ...
0
votes
1
answer
21
views
fControl.get is not a function in angular unit test
Trying to write an unit test for changeFunctionalityStatus(). facing the issue like fControl.get is not a function .
Stuck with this Anyone pls help me why this issue coming. TIA
...
0
votes
1
answer
48
views
Unit testing embedded: safety vs efficiency [closed]
I am new to unit testing embedded software and have been struggling with the tradeoff between safety and efficiency (whether that be space or time).
Here are 3 examples that highlight this:
Parameter ...
-1
votes
0
answers
19
views
Can Jest AWS Mock access data in the mock request?
I am mocking an SQSClient in my Jest tests. This is going to be called multiple times during the test and I want to assert this has been called the correct number of times.
import { mockClient } from '...
0
votes
0
answers
32
views
Unit Testing Mocking Object For EF.Property<T>
I have a method in a generic class which uses an expression tree to provide the property name that it should use to match when querying the database for existing records.
public virtual List<...