6,156 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Best practices
0
votes
1
replies
69
views
Testing in MVVM architecture. What to test and how to approach TDD?
I’m currently working on a personal Android project using Kotlin and Android Studio, following a basic MVVM architecture:
─main
│ ├───java
│ │ └───com
│ │ └───example
│ │ └───...
1
vote
1
answer
124
views
How to test the calling sequence of methods of a class?
Sometimes when I develop by TDD (Test Driven Development) I need to test the calling order of some class methods. In general I write Python code so I'll show the last test case that I have just ...
0
votes
2
answers
76
views
Write tests that check the order in which actions are done
I'm encountering a recurring challenge when using TDD to develop code that must perform actions in a specific order. Usually I'm able to write tests such that it is only possible to create a correct ...
Bart's user avatar
- 1,701
0
votes
1
answer
44
views
Gateways design in a react native app with TDD approch and clean architecture principles
I'm currently developing a mobile app for booking overnight accommodations in React Native. I'm currently developing the "book accommodation" functionality and I'm running into a design ...
3
votes
2
answers
10k
views
How can I run a uv pytest tool with proper dependencies and module paths?
Directory Structure
project-root/
├── src/
│ ├── file1.py
│ ├── file2.py
└── tests/
│ ├── test_file1.py
│ ├── test_file2.py
├── requirements.txt
├── pyproject.toml
So basically, under the project ...
1
vote
2
answers
150
views
Should I write a test for each required attribute in a Rails model or is one enough? [closed]
I'm working on a Ruby on Rails project and practicing Test-Driven Development (TDD) using Minitest.
For user authentication (using Devise), I wrote a test to check that a user cannot sign up without ...
0
votes
1
answer
154
views
Pytests using SQLAlchemy + Factory Boy are not persisting data on database
So i'm building a FastAPI application whose tests are written in Pytest. Because i have some large models, it is unpracticable for me to define different data manually each time i have to query or do ...
1
vote
2
answers
166
views
How should I compare the values of non-nullable and nullable types using ShouldBe in Shouldly?
In the following code, o[0].AccountEnabled has type bool while graphUsers[0].AccountEnabled has type bool?.
Without the explicit cast to bool?, I get the following error:
'bool' does not contain a ...
1
vote
1
answer
592
views
How to mock composable with vitest?
I'm learning TDD in simple Nuxt.js project. This project is frontend of Laravel API. And what this project does is to implement all Laravel Fortify options. So I'm using external package called nuxt-...
-1
votes
3
answers
216
views
My class doesn't generate a Fibonacci sequence properly
I'm trying to make a class that generates a Fibonacci sequence. My two modules are below, the fibonacci.py module and the test_fibonacci.py module. The first two tests pass but the third one seems to ...
0
votes
0
answers
63
views
How can I use the same test_helper function in integration tests and unit tests in rust?
So I have an integration test /tests/my_test.rs and a unit test in /src/some_module/function.rs. If I create a test helper in
/tests/test_helper.rs
pub struct TestHelper {
}
impl TestHelper {
fn ...
0
votes
2
answers
136
views
How to test debouncing logic
I'm trying to use TDD to build a search view model that debounces before searching. Until recently I would have created a mock debouncer, injected it into my view model and used that to control the ...
0
votes
1
answer
46
views
Why is Karate scenario and scenario outline generating parantheses before the name?
Am using a simple Karate runner to run my features. But the karate html output is generating my scenario thus. Its adding the [1:1:22] as prefix to the Card is not used scenario name. How can i remove ...
2
votes
1
answer
313
views
Angular testing: Error: NG0304: 'mat-form-field' is not a known element (used in the 'SignInComponent' component template)
Im trying to do a small app with TDD.
When i run npm test following error occurs:
Error: NG0304: 'mat-form-field' is not a known element (used in the 'SignInComponent' component template):
If 'mat-...
1
vote
2
answers
92
views
TDD process when you know the implementation of a new feature overlaps a previous one [closed]
I just solved this puzzle using TDD:
https://adventofcode.com/2015/day/6
I started with turnOn function and implemented like this(F#):
let turnOn (startx, starty) (endx, endy) (grid: bool[,]) =
...